Sobes.tech
Middle+

What will you do if there are no tests in the project and the client refuses to invest time and resources in their development?

sobes.tech AI

Answer from AI

In such a situation, when it is not possible to implement comprehensive test coverage, I would focus on the following steps to minimize risks and improve quality:

  • Manual testing of key scenarios: Identify the most critical functionalities and perform manual regression testing after each significant change.
  • Code quality improvement: Implement static code analyzers (e.g., flake8, Pylint) and linters (e.g., Black, Isort) to maintain a consistent style and detect potential issues.
  • Code Review: Actively participate in code review processes to identify logical errors, potential bugs, and improve code readability.
  • Logging and monitoring: Set up a logging system to track errors and exceptions in production, as well as implement basic performance monitoring.
  • Micro-tests (if possible): If time and module complexity allow, locally write small tests for critical functions, even if they are not integrated into CI/CD.
  • Documentation: Provide detailed documentation of system functionalities and expected behaviors to facilitate understanding and debugging.
  • Gradual implementation: At any convenient opportunity, such as fixing a critical bug, suggest writing a minimal test that covers the fixed scenario, arguing that it prevents recurrence of errors.
# Example of using a static analyzer
# flake8 --ignore=E501 your_module.py

# Example of using a linter
# black your_module.py

This approach can at least partially compensate for the lack of full testing and reduce the number of defects, even without direct investment in test development.