0Pricing
Groovy & Gradle: JVM Automation and Build Engineering · 강의

테스트 보고서와 필터링

테스트 보고서를 생성하고 분석하며 특정 테스트만 실행하도록 필터링하는 방법을 배웁니다.

테스트 보고서와 필터링은(는) CoddyKit의 무료 Groovy & Gradle: JVM Automation and Build Engineering 강의입니다. 이것은 4개 중 2번째 강의입니다. 아래에서 전체 강의를 무료로 읽을 수 있으며, 내장 코드 에디터와 24/7 AI 튜터와 함께 브라우저에서 직접 실습할 수 있습니다. 이 강의는 Groovy & Gradle: JVM Automation and Build Engineering 학습 경로의 일부이며, 진행 상황이 웹과 CoddyKit 앱에 동기화됩니다. Groovy & Gradle: JVM Automation and Build Engineering 강의에는 총 4개의 강의가 포함되어 있습니다.

이 강의의 일부는 아직 번역되지 않았으며 영어로 표시됩니다.

Understanding Test Outcomes

Test reports are essential for understanding the health of your project. They provide a clear summary of which tests passed, failed, or were skipped.

This insight helps developers quickly pinpoint issues, track progress, and ensure code quality. Without them, debugging would be much harder!

Automatic HTML Reports

When you run tests with Gradle, it automatically generates an interactive HTML report every time you run your tests. This feature is enabled by default when you apply the java or java-library plugin.

These reports offer a user-friendly interface to browse test results, making analysis straightforward.

Finding the Report File

After executing your tests using the test task, Gradle places the generated report in a specific directory. Look for build/reports/tests/test/index.html.

You can open this file directly in any web browser to view a comprehensive overview of your test run. To generate one, simply run: ./gradlew test

Exploring Report Details

The HTML report provides valuable details:

  • Summary: Total tests, failures, and skipped tests.
  • Test Classes: A list of all executed test classes.
  • Individual Tests: Status and duration for each test method.
  • Failure Details: Stack traces and error messages for failed tests.

This structure helps you drill down from a high-level overview to specific problem areas.

Running Specific Tests

Sometimes you don't need to run all tests. Perhaps you're debugging a specific feature or re-running a failed test.

Gradle allows you to filter which tests are executed, saving time and focusing your efforts. This is done using the --tests command-line option.

Filter by Class Name

To run all tests within a specific test class, provide its fully qualified name with the --tests flag.

For example, if you have a class named com.example.MyFeatureTest, you'd run:

./gradlew test --tests com.example.MyFeatureTest

This executes every test method inside that single class.

Execute a Single Method

You can get even more granular by specifying a particular test method within a class. Append the method name to the fully qualified class name.

If com.example.MyFeatureTest has a method testSpecificCase, use:

./gradlew test --tests com.example.MyFeatureTest.testSpecificCase

This is extremely useful for focused debugging.

Using Wildcards in Filters

Gradle's --tests option supports wildcards (*) for more flexible matching. This allows you to run groups of tests that follow a pattern.

  • *IntegrationTest: Runs all classes ending with "IntegrationTest".
  • com.example.*: Runs all tests in the com.example package and its subpackages.
  • *.testFailure*: Runs any method named `testFailure` (or similar) in any class.

Multiple Filter Patterns

You can apply multiple --tests options in a single command. Gradle will run any test that matches at least one of the provided patterns.

For example, to run tests from two different classes:

./gradlew test --tests com.example.ClassA --tests com.example.ClassB

This provides powerful control over your test execution.

Quick Check: Filtering

Consider a project with a test class com.myapp.services.UserServiceTest containing methods testCreateUser and testDeleteUser.

Which Gradle command will run only the testCreateUser method?

Recap: Reports & Filtering

In this lesson, we explored the critical role of test reports in Gradle. You learned that:

  • Gradle automatically generates detailed HTML test reports.
  • These reports are found in build/reports/tests/test/index.html.
  • You can filter test execution using the --tests option.
  • Filters can target classes, methods, or use wildcards for flexibility.

Mastering these techniques helps you efficiently manage and debug your test suite!

자주 묻는 질문

“테스트 보고서와 필터링” 강의는 무료인가요?

네 — “테스트 보고서와 필터링” 전체 내용을 이 웹사이트에서 무료로 읽을 수 있습니다. 인터랙티브하게 실습하려면(내장 코드 에디터와 24/7 AI 튜터), CoddyKit PRO로 업그레이드하면 Groovy & Gradle: JVM Automation and Build Engineering 강의 전체를 잠금 해제할 수 있습니다. Groovy & Gradle: JVM Automation and Build Engineering 강의에는 총 4개의 강의가 포함되어 있습니다.

“테스트 보고서와 필터링”에서 뭘 배우나요?

테스트 보고서를 생성하고 분석하며 특정 테스트만 실행하도록 필터링하는 방법을 배웁니다. 브라우저에서 직접 실행하는 실습 코드로 Groovy & Gradle: JVM Automation and Build Engineering을(를) 배우며, 24/7 AI 튜터가 강의를 진행하면서 질문에 답변해줍니다.

Groovy & Gradle: JVM Automation and Build Engineering을(를) 시작하는 데 경험이 필요한가요?

사전 경험은 필요하지 않습니다. CoddyKit의 Groovy & Gradle: JVM Automation and Build Engineering은(는) 초급자부터 고급 학습자까지를 위해 구성되어 있으므로, 여기서 시작하거나 처음부터 시작할 수 있으며 자신의 속도대로 진행할 수 있습니다. 이것은 4개 중 2번째 강의입니다.

“테스트 보고서와 필터링” 강의는 얼마나 걸리나요?

대부분의 CoddyKit 강의는 약 5~10분이 소요됩니다. 각 강의는 간결하고 인터랙티브하여 꾸준한 진행이 가능하며, 웹과 앱에서 중단한 부분부터 바로 시작할 수 있습니다.

이 Groovy & Gradle: JVM Automation and Build Engineering 강의에서 코드를 작성하고 실행할 수 있나요?

네. 모든 Groovy & Gradle: JVM Automation and Build Engineering 강의에는 내장 코드 에디터가 포함되어 있으므로, 브라우저에서 바로 실제 코드를 작성하고 실행한 후 즉시 AI 피드백을 받을 수 있습니다 — 로컬 설정이 필요 없습니다.

이 강의의 모든 강의

  1. 단위 및 통합 테스트
  2. 테스트 보고서와 필터링
  3. 코드 커버리지와 정적 분석
  4. 테스트 픽스처와 공유 테스트 코드
← Groovy & Gradle: JVM Automation and Build Engineering(으)로 돌아가기