About this question
What is the difference between Unit Testing and Block Testing?
What is the difference between Unit Testing and Block Testing?
Log in to share your answer and help other learners.
Log in to answerBest Answer · By JanBask Cyber Security Expert
Answered on Feb 10, 2022
I don't think block testing is a commonly accepted term. What you are probably referring to is block coverage. Unit testing is a TYPE of testing, where the smallest 'units' in an application are tested in isolation. This often means testing individual methods in a class, with mocked or stubbed external dependencies.
One level higher than unit testing is integration testing, which is meant to test the interaction between different groups of code together. This can be relatively shallow by just testing a combination of several classes, or it can be broader in the sense that you store data in a running database. In any type of test, you might be interested in how much of a certain section of code is covered by any type of test. The simplest form is line coverage where you measure the percentage of code lines that have been executed after all tests were run. This example here shows how block coverage works: https://stackoverflow.com/questions/35844439/what-is-the-difference-between-block-coverage-and-branch-coverage You can measure the coverage for both unit and integration tests.
Free tutorials and interview questions from industry experts — learn the skill, then get ready to prove it.
Step-by-step Cyber Security guides from industry experts
Common Cyber Security interview questions, answered
Guides, tips and career advice on Cyber Security from JanBask experts.
Cyber Security The Ultimate Guide to SOC Analyst Certifications: Entry-Level to Senior
Not sure which SOC analyst certification to take first? Compare Security+, CySA+, SC-200, and hands-on certs with costs, study…
Cyber Security GRC Analyst Certification Guide: Best Certs, Costs, and the Right Order
Which GRC analyst certification should you take first? Compare Security+, CGRC, CRISC, CISA, and GRCP by cost, experience needed,…
Cyber Security Penetration Tester Certification Guide: Best Certs & Order (2026)
Which penetration testing certification should you take first? Compare Security+, eJPT, PenTest+, CEH, and OSCP by cost, exam…
Cyber Security Ethical Hacker Certification Guide: Best Certs, Costs (2026)
Which ethical hacker certification should you take first? Compare Security+, eJPT, CEH, PenTest+, PNPT, and OSCP by cost, exam…