160 likes | 320 Vues
Barron’s chapter 5 Software development life cycle. Software development life cycle. The waterfall model. Analysis of the specification. Program Design. Implementation. Testing & debugging. Maintenance. Program specification.
E N D
Barron’s chapter 5 Software development life cycle
Software development life cycle • The waterfall model Analysis of the specification Program Design Implementation Testing & debugging Maintenance
Program specification • The specification is a written description of the project. Typically it is based on a customer’s requirement.
Glucose meter • a medical device for determining the approximate concentration of glucose in the blood.
What would be a specification for the glucose meter? Hardware specification: weight – 0.2lbs(75g) dimension – 3.6 in x 2.3 in x0.9 in data storage- 400 measurements CPU - .. Software specification: GUI – menu language – 26 different languages how to conduct measurement… response time – 6 seconds
Program design • The design is a detailed plan for solving the problem outlined in the specification. • Ex. User menu-
Program implementation • The coding phase. • Based on the specification, use the operating system, programming language and network specified and actually produce the menu functions. • P210, Q1- if there is no specification for something you need to implement, as a programmer, what do you do?
Implementing classes • Bottom-Up Development The independent classes are implemented and tested before incorporated into the overall project, then classes that depend on just one other class are implemented and tested, and so on. Finally all classes are linked together to form the whole system • Top-down Development An overview of the system is formulated, specifying but not detailing any first-level subsystems. Each subsystem is then refined in yet greater detail, sometimes in many additional subsystem levels, until the entire specification is reduced to base elements
question • P210, Q3 – top down • P216, Q18 – bottom up???
Testing and debugging • Not every possible input value can be tested, so selecting a representative set of test data is important. • Typical values • Endpoint values • Out of range values • If only positive input is required, test data should include a negative value • Ex: a normal glucose level 50 -140 • P211, Q7
Program maintenance This phase involves upgrading the code as circumstances change. New features may be added…So clear and precise documentation is a must.
Stub method • A stub is a dummy method that stands in for a method until the actual method has been written and tested. • Take the glucose meter as an example. What would a stub for it? Program analysis
Assertion • An assertion is a precise statement about a program at any given point. If an assertion is proved to be true, then the program is working correctly at that point. p214, Q13 int prev = 1, next = 1, sum =1; for(int i = 3; i <= n; i++) { sum = next + prev; prev = next; next = sum } return sum; } What is a correct assertion about loop variable? Program analysis
Program analysis • Efficiency An efficient algorithm is one that is economical in the use of 1) CPU time 2) Memory • 3 cases- best case, worst case, average case If the algorithm used to search a list is starting at the beginning of the list…what would be the best case, worst case and average case?
Homework • Quiz on Thursday. Study Barron’s Chapter 4-6 including all the questions handout and AP Sample test on the back of each chapters. • The first period of Thursday review the questions with your partners, second period quiz.