Maintaining Code

516 views

Published on

Maintaining code topic for SDD

0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total views
516
On SlideShare
0
From Embeds
0
Number of Embeds
3
Actions
Shares
0
Downloads
9
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide
  • Maintaining Code

    1. 1. Mo!fying So"ware Solutions A topic in an hour
    2. 2. Please write the following comments on your syllabus Algorithms Explicit integrate Reverse Changing engineer System Meaningful Standards Comments Data Indentation Outsource
    3. 3. Why did we write them down? Whe’re playing
    4. 4. Reasons for Maintenance Co!ng Changing user requirements Eg, Microsoft Word...people want to add pictures, graphs, charts, integrate excel spreadsheets, essentially...desktop publish Even clip art
    5. 5. Changing user requirements
    6. 6. Upgrading the user interface
    7. 7. Changes in the data to be processed Format from one system can be often need to be implemented into another system. If this data changes, you may need to change the new system.
    8. 8. Introduction of new hardware or soft ware Introduction of new peripherals. Eg, scanners need scanner drivers, printers need printer drivers USB Drives a major introduction in the past 4 years. Introduction of new standards of saving files Sometimes, just to be competitive
    9. 9. Changing organisational focus A company creates an program where they hire book-keepers to do their books OR A company that decides to outsource their book- keeping and only needs to enter sales/expenses
    10. 10. Changes in government requirements
    11. 11. Poorly implemented code
    12. 12. Social and ethical Implications Plaigarism You can’t reverse engineer code You must reference any code that you use Open source restrictions
    13. 13. Features in source code that improve it’s maintainability Use of variables instead of values. Radius=3 Circumference = 2 * Pi * Radius instead of Circumference =2 * Pi * 3
    14. 14. Features in source code that improve it’s maintainability Meaningful Variable Names Bob=3 c1 = 2 * Stuff * Bob instead of Circumference =2 * Pi * Radius
    15. 15. Features in source code that improve it’s maintainability Explaination comments in code Circumference =2 * Pi * Radius //radius is the distance from the centre to one edge, input by the user in a text box. Declared on form 1
    16. 16. Features in source code that improve it’s maintainability Use of Standard Control Structures For (i= 1 to 10) Bob = i + 1; Next i OR Bob =i + 1 Go to line 10 until i =10
    17. 17. Features in source code that improve it’s maintainability A clear and uncluttered program Use of indentation! /*Simple HelloButton()method version 1.0 author JohnDoe*/ HelloButton(){JButton hello=new JButton (“Hello World”);hello.addActionListener( new HellowBtnList) JFrame frame=newFrame(“Hello Button”); Container pane = frame.getContentPane(); pane.add(hello);
    18. 18. Features in source code that improve it’s maintainability One logical task per subroutine! This means that subroutines can be reused for different things within other programs and also If say, data changes, you don’t have to get rid of every process, only those that have to do with saving in that format.
    19. 19. Interpretation Documentation of the process, and product should be availiable for developers to interpret code. Documentation can be: Internal or External External can be based around: Development : for developers by developers Use: for users by developers
    20. 20. Algorithms (and IPO) are the best things to look back to to be able to understand and modify code Sometimes, when algorithms are not stored they need to be rewritten to understand: Inputs Types of Variables Processes Outputs
    21. 21. Use supplied documentation to Identify how control structures have been used Explain how variables have been used. Documentation: The following is a piece of code supplied to you. You need to: Convert the code to an algorithm
    22. 22. code For J=0 to Last ThisChar=textEntry.Text.Chars(J) If IsLetter(ThisChar) or ThisChar “ ‘ “ If Not InAWord Then WordCount +=1 End If InAWord=True Else InAWord=False End If Next J
    23. 23. What was all this about again? Coding so that it is easier for people to modify, making your code explicit Being able to modify other people’s code

    ×