How test engineers can help improve the quality of the development domain

1. SonarQube's technical debt

The technical debt of Gitlab's repo scanned by SonarQube needs to be cleared. During the iteration process, the team needs to continue to pay attention to the technical debt, maintain a stable downward trend of technical debt, establish a technical story card for repairing technical debt (for example, as follows), and submit in the corresponding Fill in the ID of the technical story card in the requirement id in the commit message that needs to submit the code.

10% reduction in front-end and back-end technical debt
AC1: The back-end code base reduces sonar scanning problems, and BUG, ​​loopholes, and bad smells are reduced by 10%
AC2: Configure idea local sonarlint plug-in for backend development (be careful not to introduce new problems during development)

2. Unit testing

Two practices of unit testing:

  • The common development mode realizes the development and implementation of the logic code of the story card, and then writes the unit test according to the written code to test the unit module.
  • Developers who adopt test-driven development, according to AC or test cases in user stories, first write test cases, and then develop functional modules.

Some rules for unit testing:

  • External function calls and external service calls of the function under test need to be decoupled (Java recommends mockito).
  • The functions under test that access databases, message middleware, redis and other middleware need to be decoupled.
  • The path of the test class under the test directory should be consistent with the path of the tested class under src/main/java. Through the agreed rules, the test class corresponds to the tested class, which is convenient for viewing and positioning.
  • test class command

Guess you like

Origin blog.csdn.net/chenlei_525/article/details/127976208