Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Aprenda Challenge: Simulate Test Coverage Tracking | Advanced QA Automation Techniques
Python for QA Engineers

bookChallenge: Simulate Test Coverage Tracking

Understanding and monitoring test coverage is a crucial aspect of quality assurance, as it helps you identify which parts of the codebase have been exercised by your tests and which have not. By simulating test coverage tracking, you can gain practical insights into how coverage tools operate and why they are valuable for continuous QA improvement. In this challenge, you will create a Python script that maintains a set of function names as they are "called" during test execution, then reports which functions from a predefined list were covered and which were not. This hands-on exercise reinforces the importance of thorough testing and the value of coverage metrics in real-world QA workflows.

Tarefa

Swipe to start coding

Write a Python function to simulate test coverage tracking for a list of functions. You are provided with a list of all function names that should be tested, and a list of function names that were actually called during test execution.

  • Identify which function names from functions_to_test are present in tested_functions.
  • Identify which function names from functions_to_test are not present in tested_functions.
  • Prepare a string listing the covered functions, separated by commas, in sorted order.
  • Prepare a string listing the untested functions, separated by commas, in sorted order.
  • Print the covered functions with the label "Tested functions:".
  • Print the untested functions with the label "Untested functions:".

Solução

Tudo estava claro?

Como podemos melhorá-lo?

Obrigado pelo seu feedback!

Seção 3. Capítulo 7
single

single

Pergunte à IA

expand

Pergunte à IA

ChatGPT

Pergunte o que quiser ou experimente uma das perguntas sugeridas para iniciar nosso bate-papo

Suggested prompts:

Can you explain how to simulate function calls for coverage tracking?

What should the predefined list of functions look like?

How do I report which functions were covered and which were not?

close

bookChallenge: Simulate Test Coverage Tracking

Deslize para mostrar o menu

Understanding and monitoring test coverage is a crucial aspect of quality assurance, as it helps you identify which parts of the codebase have been exercised by your tests and which have not. By simulating test coverage tracking, you can gain practical insights into how coverage tools operate and why they are valuable for continuous QA improvement. In this challenge, you will create a Python script that maintains a set of function names as they are "called" during test execution, then reports which functions from a predefined list were covered and which were not. This hands-on exercise reinforces the importance of thorough testing and the value of coverage metrics in real-world QA workflows.

Tarefa

Swipe to start coding

Write a Python function to simulate test coverage tracking for a list of functions. You are provided with a list of all function names that should be tested, and a list of function names that were actually called during test execution.

  • Identify which function names from functions_to_test are present in tested_functions.
  • Identify which function names from functions_to_test are not present in tested_functions.
  • Prepare a string listing the covered functions, separated by commas, in sorted order.
  • Prepare a string listing the untested functions, separated by commas, in sorted order.
  • Print the covered functions with the label "Tested functions:".
  • Print the untested functions with the label "Untested functions:".

Solução

Switch to desktopMude para o desktop para praticar no mundo realContinue de onde você está usando uma das opções abaixo
Tudo estava claro?

Como podemos melhorá-lo?

Obrigado pelo seu feedback!

Seção 3. Capítulo 7
single

single

some-alt