Testing Worshop in Software Engineering Project Department of Computer Science Ben-Gurion university 1Worshop in SE ProjectSpring 2013
Software Engineering, 2005Design Patterns – Creational patterns 2 Classification Tests are boolean: Pass or fail! 1.White-box testing: 1.Unit testing 1.Follow computation paths (code coverage) 2.Test scenarios derived from use cases (data coverage) 3.Test non-functional requirements (data coverage) 2.Integration testing 1.Test integration scenarios derived from functional and non- functional requirements 2.Black-box testing 1.Test scenarios derived from use cases (data coverage) 2.Test non-functional requirements (data coverage) 3.Regression testing
Software Engineering, 2005Design Patterns – Creational patterns 3 Unit testing – Follow computation paths 1.White-box testing: 1.Unit testing 1.Follow computation paths (code coverage) 2.Test scenarios derived from use cases (data coverage) 3.Test non-functional requirements (data coverage) Code coverage: Statement, line coverage Branch coverage Code complexity – e.g., cyclomatic complexity Related to data coverage
Software Engineering, 2005Design Patterns – Creational patterns 4 Unit testing – Use-case scenarios 1.White-box testing: 1.Unit testing 1.Follow computation paths (code coverage) 2.Test scenarios derived from use cases (data coverage) 3.Test non-functional requirements (data coverage) Use-case coverage: Build scenarios for use-case alternatives Use sequence diagrams for scenario specification What is the relevance of use-case diagrams? Data coverage How to test “big, complex” data, like a big graph?
Software Engineering, 2005Design Patterns – Creational patterns 5 Unit testing – Non-functional requirements 1.White-box testing: 1.Unit testing 1.Follow computation paths (code coverage) 2.Test scenarios derived from use cases (data coverage) 3.Test non-functional requirements (data coverage) How to create Data? How to test success/failure Beware of side-effects
Software Engineering, 2005Design Patterns – Creational patterns 6 Integration testing 1.White-box testing: 1.Unit testing 2.Integration testing 1.Test integration scenarios derived from functional and non- functional requirements 1.Use sequence diagrams to emphasize inter-module interaction
Software Engineering, 2005Design Patterns – Creational patterns 7 Black-box: Test Use case scenarios How different from white-box testing? 1.Black-box testing Positive tests Negative tests Use customer advice for testing data 1.Test scenarios derived from use cases (data coverage) 2.Test non-functional requirements (data coverage)
Software Engineering, 2005Design Patterns – Creational patterns 8 Recommended blog and lecture: How to write non-testable code: untestable-code.html untestable-code.html How to Write Clean, Testable Code