System Testing & Static Analysis Report 201011316 200913247 - - PowerPoint PPT Presentation
System Testing & Static Analysis Report 201011316 200913247 - - PowerPoint PPT Presentation
System Testing & Static Analysis Report 201011316 200913247 201011373 Index Non-functional requirement validation Specification and code review System testing report Static analysis report
Index
- Non-functional requirement validation
- Specification and code review
- System testing report
- Static analysis report
Non-functional Requirement Validation
- Well met
Specification & Code Review
- displayS() in Interface doesn’t exist
- Attribute db is not protected
- Message is not in associative relationship
Specification & Code Review
- Data type variable name (x)
- Variable name : data type (o)
Specification & Code Review
- Program logic is all in Interface
- Doesn’t take advantage of OOP
Specification & Code Review
- Diagram and implementation differ
Specification & Code Review
- Diagram shows exception case should happen
Specification & Code Review
- Message instance created then right after
receives a new instance
- This happens several times!
CPT Result (last week)
- 56개중 45개 성공
CPT Result (this week)
- 56개중 50개 성공
Failed Test Case Report
- 데이터베이스에 없는 단어를 검색하면 몇몇
단어는 단어와 의미가 똑같이 나옴
– Apple = apple – 지난주의 문제가 개선되지 않음
Pairwise Testing (last week)
- 16개중 13개 성공
Pairwise Testing (this week)
- 16개중 16개 성공
Brute-force Testing (last week)
- 28개 중 12개 성공
Brute-force Testing (this week)
- 28개 중 20개 성공
Failed Test Case Report
- 8~9, 19~23번 아이 모드를 클릭하면 “ui에러” 경
고창이 뜸
Miscellaneous
- 모드 선택 후 창이 뜨는데 시간이 매우 10초 이상
걸림
- 아이 모드에서 정답을 제출하지 않으면 비활성화
된 버튼이 다음 문제로 넘어가도 활성화가 안됨
- 마찬가지로 정답을 입력하고 지워도 활성화가
안됨
- 삭제 버튼이 ui 업데이트를 안함
- 몇몇 단어는 검색이 안됨 (i.e. apple, cow)
- 업데이트된 프로그램은 마지막 테스트 결과에서
발견한 문제점을 개선하는 방향보단 없앤 것이 많아 보임
Jfeature & Redmine
Static Analysis
- SonarQube 7 axis of code quality
– Architecture & design – Duplications – Unit tests coverage – Complexity – Potential Bugs – Coding Rules – Comments
Basic metrics
size
Architecture & Design
- Covers
– File cycles
- Minimal number of files cycles in a directory to identify all
undesired dependencies
– Files dependencies to cut – Package cycles
- Minimal number of directory cycles to identify all
undesired dependencies
– Package dependencies to cut
- This project has no directory nor package
– Nothing measured on architecture & design
Architecture & Design
- Some suggestions
– Divide classes into packages
- UI
- Database
- Talkkid
- Common – Message, Word
Duplications
- All duplications found in Interface.java
Duplications
- 349 ~ 365, 656 ~ 672
- Adding “go to main” button on both child and
parent UI
Duplications
- 773 ~ 790, 796 ~ 813
- Overloaded methods
- Implemented very similarly
- Can be coded to get string array
Duplications
- 677 ~ 692, 858 ~ 872, 891 ~ 904, 915 ~ 928
- Makes a new table whenever table is changed
- Queries database everytime and retrieves all
data to re-create the table again
– Get table model from jtable and use addRow(), removeRow() etc.
- Duplicated 4 times
Unit Test Coverage
- SonarQube analyzes on
– Coverage – Condition coverage – Line coverage – Unit test success/failure – Etc
- This project has no unit test!
Complexity
- Also known as McCabe metric
- Control flow of a function splits, the complexity
counter gets incremented by one
- Keywords that increases the complexity
– if, for, while, case, catch, throw, return (not the last statement of a method), &&, ||, ?
- Keywords that do not increase the complexity
– Else, default, finally
- Accessors do not increase complexity
- McCabe saw threshold upto 10
Complexity
- Overall complexity
File Complexity Complexity / method Interface.java 149 8.8 Database.java 35 8 Parent.java 32 6.4 Child.java 12 4.4 User.java 8 4 Word.java 1 1 Message.java 1 1
Potential Bugs & Coding Rules
File Number of errors Interface.java 2,990 Database.java 498 Parent.java 303 Child.java 214 User.java 113 Word.java 110 Message.java 109
- Sonar rules + PMD + Check Style + Findbugs
Potential Bugs & Coding Rules
- Critical errors
Rule Count Exception handlers should preserve the original exception 18 Throwable.printStackTrace(...) should never be called 6 Fields in a "Serializable" class should either be transient or serializable 5 Dodgy - Redundant nullcheck of value known to be non-null 4 Empty If Stmt 3 Dodgy - Dead store to local variable 1 Rule Count Require This 573 Law Of Demeter 95 Line Length 79 Empty Line Separator 75 Javadoc Method 68 Javadoc Variable 63
- Major errors
Comments
- Public methods have no documentation
- Too few comments
– Reader has to guess how the program works
- Too many comments
– May take more time in just reading the comments – Too many comments are needed too complex or it doesn’t follow the coding standards
Developer’s Seven Deadly Sins
- Bugs and Potential Bugs
- Coding Standards Breach
- Duplications
- Lack of Unit Tests
- Bad Distribution of Complexity
- Spaghetti Design
- Not Enough or Too Many Comments