Testing Theory - code coverage

  1. Outline
    1. I know what sort of code coverage
  2. background
    1. Appreciated that the white box case design
    2. Over design, a standard always necessary to evaluate certain aspects of the use of the embodiments
      1. This may be, it is the meaning of the coverage proposed
      2. As to who first proposed this, and for what purpose, it is now difficult to trace
        1. Mostly I'm too lazy to research ...

1. Review: white box test case design ideas with

  1. Outline
    1. Recall design ideas white-box use cases
  2. Thinking
    1. Code coverage
    2. Branch coverage
    3. Condition coverage
    4. Branch condition coverage
    5. Multiple condition coverage
  3. ref
    1. Will be back

2. Coverage

  1. Outline
    1. Brief coverage
  2. Coverage
    1. effect
      1. Measure the degree of test cases to test the code
    2. significance
      1. Where there is no test to identify those
        1. Pay attention to portion not covered
        2. The focus is to explain these issues
          1. Why are not covered
          2. You can cover
      2. For quality testing, without any representation
        1. Yes, high coverage, not necessarily test well
    3. Calculation
      1. Code coverage
        1. Coverage = Number of measured line / total number of lines of code
      2. Of course, there are other coverage
        1. How those counted, there may be talk back

3. Common coverage indicators

  1. Outline
    1. To jacoco indicators, for example, briefly explain
  2. jacoco execution results
    1. Outline
      1. Brief description of the results of the next jacoco
    2. Row
      1. Element
        1. Test package
      2. Missed Instructions & Cov
        1. Instruction covering
      3. Missed Branhes & Cov
        1. Branch coverage
      4. Missed & Cxty
        1. Cyclomatic complexity
      5. Missed & Lines
        1. Code coverage
      6. Missed & Method
        1. Methods covered
      7. Missed & Classes
        1. Class overrides

1. Instruction cover

  1. Outline
    1. Instruction-level coverage
  2. instruction
    1. Java code is compiled final results of binary code
      1. So then it does not matter, and code format
  3. Instruction coverage
    1. This coverage is a relatively low-level coverage
      1. I felt some of the covering method mentioned before, not so direct correlation
        1. So understanding will be some strange feeling
    2. Independent code
      1. Code format, this will not affect coverage
        1. Only final binary code, would be affected
      2. Not even code source files, can be used to try coverage
    3. other
      1. Simple search of the investigation data and found that basically said is vague
        1. The said independent code, and size-covered
        2. Specifically how to use, few mention

2. branch coverage

  1. Outline
    1. Branch level coverage
  2. Branch
    1. contain
      1. if
      2. switch
  3. Branch coverage
    1. significance
      1. A measure of the extent of the testing branch
  4. prompt
    1. No cover
      1. Code comes with a red background
    2. Partially covered
      1. Code comes with a yellow background
    3. Completely covered
      1. Code comes with a green background

3. cyclomatic complexity

  1. Outline
    1. Cycle-related coverage
  2. Cyclomatic complexity
    1. Outline
      1. This is a graph theory related concepts
        1. discrete mathematics...
    2. Object Description
      1. Code as a whole
        1. Not cycling
    3. significance
      1. Description overall complexity code
        1. The lower the code is easy to understand
  3. Cyclomatic complexity of jacoco
    1. I'm sorry I really did not understand
      1. It feels like a bit like a branch coverage
      2. But there are real differences
    2. This can only be a regret

4. Code Coverage

  1. Outline
    1. Row-level code coverage
  2. Row
    1. Is the line of java code
  3. Code coverage
    1. significance
      1. A measure of the extent of testing of lines of code
  4. prompt
    1. Testing with branch

5. The method of covering

  1. Outline
    1. Method-level code coverage
  2. method
    1. method
      1. Certain methods do not count on the inside
      2. This supplement will be free, for example, which I will take into account, there is no result
        1. Abstract method
        2. Interface Method
        3. Construction method
        4. finalize
    2. Methods covered
      1. A method, as long as the line of code is executed, even if the covering
  3. Methods Coverage
    1. significance
      1. Test the extent of measurement methods

6. class overrides

  1. Outline
    1. Class level code coverage
  2. class
    1. class
      1. Certain classes do not count on the inside
      2. This will supplement free
    2. Class overrides
      1. A class, as long as the line of code is executed, even if the covering
      2. This supplement will be free, for example, which I will take into account, there is no result
        1. Abstract class
        2. Interface classes
        3. No direct interface to achieve class of nameless
  3. Class Coverage
    1. significance
      1. Tests measure the degree of class

ps

  1. ref
    1. Testing Theory - white-box testing - test case design
      1. I sort of cases before the white box with design ideas
    2. Talking to praise test code coverage
      1. Understanding of the significance of the coverage, I feel very good, it is worth thinking
      2. To explain the mechanism of coverage tools, I do not think much
        1. Feeling a little casual, intermittent speaks
    3. jacoco
      1. Some explain the principles of jacoco
      2. Currently have not seen, there is time to savor
        1. jacoco report, for a description of the parameters, is the official website of document translation
        2. jacoco
    4. Incremental code coverage tool
      1. Like test team has made improvements to jacoco
        1. Incremental test the code coverage tool
          1. Have time to savor
    5. Cyclomatic Complexity
      1. Cyclomatic complexity
  2. Follow-up
    1. Understand some of the tools
      1. JaCoCo
        1. here
        2. maven
        3. jenkins
      2. IDEA Code Coverage
        1. here
      3. SonarQube
        1. jenkins

Guess you like

Origin www.cnblogs.com/xy14/p/11917650.html