(This Week) • Assignment 04 (Junit Test) • A Sample Exam is available for you to test your access to Lock Down Browser. It has no value, and you can take it as many times as needed. Test your system ASAP
(Next Week) • Second Midterm Exam Next Week. During the lecture time. No lecture that day. Lockdown browser will not allow you to use Zoom • Exercise 06 will open. It is about Cyclomatic Complexity.
§ Review, Understand, and Follow the Online Proctored Exam Guidelines § During the exam, show your environment. § It is a CLOSED BOOK exam. Do not use any material § Scratch paper is allowed. Show it on camera when you show your environment!
Etiquette • What course? CSE 360 • What section? Tuesday or Thursday • Is it about a grade? First, contact the TA • Is it about a medical condition? Include documentation • Use your ASU email
topics 1. Diagrams (Sequence Diagram) 2. Version Control and GitHub 3. Abstraction, Encapsulation, Relationships, Polymorphism, Cohesion, Coupling 4. Design Patterns: Observer and Decorator 5. Algorithms: Decision tables and trees
Testing § Testing is intended to show that a program does what it is intended to do (validation) and to discover program defects (verification) before it is put into use. § When you test software, you execute a program using artificial data. § You check the results of the test run for errors, anomalies or information about the program’s non-functional attributes. § Testing can reveal the presence of errors NOT their absence. § Testing quality is only as good as the test cases you give it.
Testing developer independent tester Understands the system but, will test "gently" and, is driven by "delivery" Must learn about the system, but, will attempt to break it and, is driven by quality
Box Testing Knowing the specified function that a product has been designed to perform, tests to demonstrate each function is fully operational while at the same time searching for errors in each function CHAPTER 8 SOFTWARE TESTING 18
Box Focus Attempt to find errors in following categories § Incorrect or missing functions § Interface errors § Errors in data structures or external database access § Performance errors § Initialization and termination errors Performed in later stages of testing 19 10/29/20 CHAPTER 8 SOFTWARE TESTING
Box Testing Knowing the internal workings of a product, tests can be conducted to ensure that internal operations are performed according to specifications i.e., the goal is to ensure that all statements and conditions have been executed at least once CHAPTER 8 SOFTWARE TESTING 10/29/20
Box | Control-flow-based Testing • Step 1: from the source, create a graph describing the flow of control, called the control flow graph (extracted from the source code) manually or automatically) • Step 2: design test cases to cover certain elements of this graph (Nodes, edges, paths) 22 10/29/20 CHAPTER 8 SOFTWARE TESTING
§ Statement Coverage: every statement in the code is executed at least once. § Decision or Branch Coverage: each one of the possible branch from each decision point is executed at least once and thereby ensuring that all reachable code is executed: (1) True and false branches of each IF; (2) The two branches corresponding to the condition of a loop; (3) All alternatives in a SWITCH statement § Condition Coverage : each boolean expression must be evaluated to true and false at least once. For example: • Path Coverage: every path is executed at least once.
or Branch coverage • Decision or Branch coverage has been considered a necessary testing minimum. To achieve it: pick a set of start-to-end paths (in the CFG) that cover all branches, and then write test cases to execute these paths
2 // use another test case // test case 2: values a = 0; b = 0; c = 5; if(a==5 || b==5){ System.out.println("Bye"); } else { if(c==5){ System.out.println("Hi"); } } // 100% statement coverage (with 2 test cases) // ??% branch coverage (with 2 test cases) 29 10/29/20 CHAPTER 8 SOFTWARE TESTING