Javier Gonzalez-Sanchez | CSE360 | Summer 2018 | 2 Announcement • Assignment 04 is open and it is due June 30. • Quiz 04 will be later this week about Unit Testing • The Final Exam is on July 7
Javier Gonzalez-Sanchez | CSE360 | Summer 2018 | 5 Definition • Validation. It is about requirements. Are we building the right product? Does this software do what it needs to do? • Verification. It is about design. Are we building the product right? Does this meet it requirements? • Testing. Examination of the behavior of a program by executing it on sample data sets.
Javier Gonzalez-Sanchez | CSE360 | Summer 2018 | 8 Unit Testing • Unit testing is the testing of an individual unit or group of related units. • It test that a unit is producing expected output against given input. • Each Unit developer must define Unit Test Cases for that Unit. • Unit Testing Frameworks are tools and libraries that help to implement the Unit Testing process. Example JUnit
Javier Gonzalez-Sanchez | CSE360 | Summer 2018 | 11 Limitations and Constraints • Missing or Bad requirements • Limited time and money • Exhaustive testing is not possible • Sampling
Javier Gonzalez-Sanchez | CSE360 | Summer 2018 | 13 Coverage • Statement Coverage: every statement is executed at least 1 time. • Decision Coverage: every decision point is executed at least 1 time • Decision-Condition Coverage: every decision tested with all possible outcomes
Javier Gonzalez-Sanchez | CSE360 | Summer 2018 | 14 Statement Coverage 1. if (a <10 || b>5) 2. x = 50 3. else 4. x = 0; 5. if (w == 5 || y>0) 6. z = 48; 7. else 8. z = 5; Total Statements? Statement Coverage with a = 0, b=0, w=0, y=0 ? Statement Coverage with a=10, b=4, w=5, y = anything ? Coverage is cumulative
Javier Gonzalez-Sanchez | CSE360 | Summer 2018 | 16 Decision-Condition Coverage 1. if (x<1 || y>5 a&& z!=0 || flag== T && s==NIL) 2. doThis(); 3. else 4. doThat(); Total Statements? Test cases needed for 100% statement coverage? Test cases needed for Test for 100% decision coverage? Test cases needed for Test for 100% decision-condition coverage?
CSE360 – Introduction to Software Engineering Javier Gonzalez-Sanchez [email protected] Summer 2022 Disclaimer. These slides can only be used as study material for the class CSE360 at ASU. They cannot be distributed or used for another purpose.