Unit 3 of 4 · B.Sc IT Sem 6

Unit 3: Testing tools and object-oriented testing

Software Testing and Quality Assurance notes · PTU syllabus (BSIT602)

3 min read7 topics10 exam questions
On this page
  1. Unit summary
  2. Comparative evaluation of testing tools
  3. Dynamic analysis tools
  4. Test data generators, debuggers and test drivers
  5. Technical metrics for software
  6. Object-oriented testing strategies
  7. Object-oriented test case design
  8. Interface testing
  9. Key terms
  10. Quick revision
  11. Important questions

Unit summary

Tools multiply testers' productivity, and object-oriented software needs its own test strategies. This unit covers comparative evaluation of testing tools, dynamic analysis tools, test data generators, debuggers and test drivers, technical metrics for analysis, design, testing and source code, object-oriented testing strategies, test case design and interface testing.

After this unit you can

  • Compare categories of testing tools
  • Explain dynamic analysis tools, test data generators, debuggers and drivers
  • Apply technical metrics
  • Test object-oriented software and interfaces

PTU syllabus topics

  • Comparative evaluation of testing tools
  • dynamic analysis tools
  • test data generators
  • debuggers
  • test drivers
  • technical metrics for software (analysis, design, testing, source code)
  • object-oriented testing strategies
  • test case design
  • interface testing
Key termsTesting techniques
Equivalence partitioning
Test one value from each input class
Boundary value analysis
Test at and around the edges
Statement coverage
Every line runs at least once
Branch coverage
Every decision true and false
Regression testing
Re-test after changes
1

Topic 1

Comparative evaluation of testing tools

ComparisonCategories of testing tools
Purpose
Examples

Test management

Plan tests, track execution and requirements

TestRail, Zephyr, Azure Test Plans

Functional and UI automation

Record or script user actions

Selenium, Playwright, Cypress, Appium

Unit testing frameworks

Automate developer tests

JUnit, PHPUnit, pytest, NUnit

Performance and load

Simulate many users

JMeter, LoadRunner, k6

Static analysis

Inspect code without running it

SonarQube, ESLint, Checkstyle

API testing

Test web services

Postman, REST Assured

Defect tracking

Log and manage defects

Jira, Bugzilla

Key termsCriteria for selecting a tool
Fit
Supports your technology and test levels
Cost
Licence, training, maintenance — open source vs commercial
Ease of use
Learning curve, scripting language
Integration
CI/CD pipelines, defect tracker, version control
Reporting
Clear results and dashboards
Vendor and community support
Updates, documentation
2

Topic 2

Dynamic analysis tools

  • Static analysis examines code without executing it; dynamic analysis observes the program while it runs.
Key termsDynamic analysis tools
Coverage analysers
Measure statements and branches executed — JaCoCo, gcov
Memory analysers
Detect leaks and invalid access — Valgrind, AddressSanitizer
Profilers
Find time and resource hot spots — VisualVM, perf
Run-time monitors
Watch threads, assertions and exceptions in execution
3

Topic 3

Test data generators, debuggers and test drivers

ComparisonSupporting tools
Function
Example

Test data generator

Creates input data — random, from specifications, or by path analysis

Faker libraries; database seeders; fuzzers

Debugger

Runs code step by step with breakpoints, watches and call stacks to locate faults

GDB, IDE debuggers

Test driver

Calls the unit under test with inputs and checks results

JUnit test class

Stub

Stands in for a called module not yet ready

Mock objects — Mockito

4

Topic 4

Technical metrics for software

ComparisonTechnical metrics
Measures
Examples

Analysis model metrics

Size and functionality from requirements

Function points, number of use cases

Design model metrics

Structure and complexity of design

Fan-in and fan-out, coupling, cohesion, depth of inheritance tree, CK metrics suite

Source code metrics

Code size and complexity

LOC, Halstead length and volume, cyclomatic complexity

Testing metrics

Effectiveness and progress of testing

Test coverage, tests passed, defects found per test hour

Key formulasHalstead metrics
  • Program length

    N = N1 + N2 (total operators and operands)

  • Vocabulary

    n = n1 + n2 (distinct operators and operands)

  • Volume

    V = N × log₂ n

5

Topic 5

Object-oriented testing strategies

  • OO features change testing: the smallest testable unit is the class; encapsulation hides state; inheritance means inherited methods must be retested in the new context; polymorphism multiplies possible behaviours.
ProcessOO testing strategy
  1. 1Class (unit) testing

    Test operations and state behaviour of each class

  2. 2Integration testing

    Thread-based (classes for one input or event) or use-based (independent classes first, then dependent)

  3. 3Cluster testing

    Collaborating classes together

  4. 4Validation testing

    Use cases and user-visible behaviour

  5. 5System testing

    Whole system with recovery, security, stress tests

6

Topic 6

Object-oriented test case design

Key termsOO test case design methods
Fault-based testing
Design tests for plausible faults
Scenario-based testing
Derive tests from use cases and user tasks
Random testing of a class
Random valid sequences of operations — open, deposit, withdraw, close
Partition testing
Group operations by state, attributes or category
Inter-class testing
Test messages among collaborating classes
State-based testing
Exercise every state transition from the state diagram

Example

Account class sequence tests: open → deposit → withdraw → balance → close; also invalid sequences such as withdraw before deposit, to check that exceptions are raised.

7

Topic 7

Interface testing

  • Interface testing checks that modules, classes, APIs and systems exchange data correctly.
Key termsInterface errors and tests
Interface misuse
Wrong parameter type or order — test every call
Interface misunderstanding
Wrong assumptions about behaviour — test boundaries and empty inputs
Timing errors
Producer and consumer at different speeds — test delays and concurrency
API testing
Check status codes, response data, error handling — Postman
User interface testing
Navigation, validation messages, accessibility

Key terms

Dynamic analysis
Analysing a program while it executes
Test data generator
Tool that creates inputs for testing
Debugger
Tool for stepping through code to locate faults
Halstead metrics
Metrics based on counts of operators and operands
Interface testing
Testing data exchange between components

Quick revision

  • Tool categories and selection criteria.
  • Coverage analysers, memory analysers, profilers.
  • Test data generators, debuggers, drivers and stubs.
  • Analysis, design, code and testing metrics; Halstead.
  • OO testing strategy; fault-based, scenario-based, random, partition, state-based tests; interface testing.

Important exam questions

Practice questions written to the PTU exam pattern for this unit's syllabus: short answers (Section A style) and long answers (Sections B and C style).

Short-answer questions

  1. Q1.Distinguish static and dynamic analysis.
  2. Q2.Name two test automation tools.
  3. Q3.What is a test driver?
  4. Q4.Define Halstead volume.
  5. Q5.Why must inherited methods be retested?
  6. Q6.What is interface misuse?

Long-answer questions

  1. Q1.Explain the categories of testing tools and how to evaluate them.
  2. Q2.Explain dynamic analysis tools, test data generators, debuggers and drivers.
  3. Q3.Explain technical metrics for software.
  4. Q4.Explain object-oriented testing strategies and test case design.

Stuck on this unit?

Message SBS on WhatsApp for help with Software Testing and Quality Assurance, or to ask about studying B.Sc IT at Synetic.

WhatsApp us