0
4.6kviews
Compare Black box and White Box Testing. Find cyclomatic complexity of following code

Compare Black box and White Box Testing. Find cyclomatic complexity of following code

$IF A= 10 THEN \\ IF B \gt C THEN - \\ \hspace{2 cm}A=B \\ \hspace{2 cm}ELSE A= C \\ END IF \\ END IF \\ \hspace{2 cm}PRINT A \\ \hspace{2 cm}PRINT B \\ \hspace{2 cm}PRINT C$


Mumbai University > Computer Engineering > Sem6 > Software Engineering

Marks: 10M

Year: May 2015

1 Answer
2
50views

Comparison of Black box and White Box testing

Criteria Black Box Testing White Box Testing
Definition Black Box Testing is a software testing method in which the internal structure/ design/ implementation of the item being tested is NOT known to the tester,Also called behavioural testing White Box Testing is a software testing method in which the internal structure/ design/ implementation of the item being tested is known to the tester. Also called glass box testing
Levels Applicable To Mainly applicable to higher levels of testing:
- Acceptance Testing
- System Testing
Mainly applicable to lower levels of testing:
- Unit Testing
- Integration Testing
Responsibility Generally, independent Software Testers Generally, Software Developers
Programming Knowledge Not Required Required
Implementation Knowledge Not Required Required
Basis for Test Cases Requirement Specifications Detail Design
Type Black box testing means functional test or external testing White box testing means structural test or interior testing
Aim check on what functionality is performing by the system check on how System is performing
Suitable for This type of project suitable for large projects This type of project suitable for small projects

1. Cyclomatic Complexity

1) Let us first number the given code

  1. IF A=10 THEN
  2. IF A>B THEN
  3. A=B
  4. ELSE A=C
  5. END IF
  6. END ID
  7. PRINT A
  8. PRINT B
  9. PRINT C

2) Flow graph to compute cyclomatic complexity

enter image description here

Cyclomatic Complexity $= E – N + 2 \\ =9 – 9 + 2 \\ = 2$

Hence the Cyclomatic Complexity of given code is 2.

Please log in to add an answer.