eloidieme / DD2480_Coverage

Scrapy, a fast high-level web crawling & scraping framework for Python.
https://scrapy.org
BSD 3-Clause "New" or "Revised" License
0 stars 0 forks source link

Implement branch coverage by manual instrumentation of the source code for run in check.py #4

Open Ziosan13 opened 8 months ago

Ziosan13 commented 8 months ago
  1. Identify all branches in the given functions; assign a unique number (ID) to each one.
  2. Before the program starts (before the first instruction in “main” or as the first step in the unit test harness), create data structures that hold coverage information about specific branches.
  3. Before the first statement of each branch outcome (including to-be-added “else” clauses if none exist), add a line that sets a flag if the branch is reached.
  4. At the end of the program (as the last instruction in “main” or at the end of all unit tests), write all information about the taken branches taken to a file or console.
Ziosan13 commented 8 months ago

run is used in TextTestResult.printsummary