Testing

Testing

Make sure code behaves as expected.

Testing and test-driven development is an important part of professional coding. Our IDEs come with a friendly user interface for writing and running tests, using a variety of frameworks.

See Also

Better 11ty Development with Tooling

tutorial

Better 11ty Development with Tooling
Getting a component-driven development experience that fits nicely into the 11ty zen.
pytest vs Unittest, Which is Better?

JetBrains Blog

pytest vs Unittest, Which is Better?
Python, being a versatile and widely used programming language, offers several testing frameworks to facilitate the testing process. Two prominent choices are pytest and unittest, both of which come with their own sets of features and advantages.
Testing and debugging

Part of tutorial

Testing and debugging
Testing and debugging in IntelliJ IDEA
Do you do enough testing? pytest to the rescue!

YouTube

Do you do enough testing? pytest to the rescue!
Join us to learn how you can use pytest to find bugs, improve code quality, and even have some fun along the way.
An Interview with Brian Okken - the pytest storyteller

JetBrains Blog

An Interview with Brian Okken - the pytest storyteller
Brian wears many hats including being a host for multiple Python podcasts and the author of Python Testing with pytest and has recently launched his new pytest course. Mostly, Brian spends his free time telling people they should write good, clean automated tests, specifically using pytest.
Productive pytest with PyCharm

YouTube

Productive pytest with PyCharm
Testing is a major part of Python development and pytest has become the leading testing framework. Brian Okken, author of the recent book Python Testing with pytest and host of the Test and Code podcast, helps you “level up” your pytest skill.
Three pytest features you will love

JetBrains Blog

Three pytest features you will love
One of the most popular frameworks for Python is pytest, and it comes with several cool features. I’m going to show you three of them in this blog post.
Show diff for failing test

tip

Show diff for failing test
Quickly see the diff for failing test
Generate a Test Class

tip

Generate a Test Class
Generate a new test class from your Java class
Navigate to Test

tip

Navigate to Test
Go to your matching test class
Highlights of GoLand 2023.3

playlist

Highlights of GoLand 2023.3
Explore key features and enhancements in GoLand 2023.3.
Code coverage for applications

tip

Code coverage for applications
Track code execution and identify dead code effectively
Unit testing

Part of tutorial

Unit testing
What is RiderFlow? And where to find it?
Unit testing

Part of tutorial

Unit testing
The Unreal Engine testing framework is built in and works without additional configuration.
Marco Codes - Hibernate & JPA Tutorial

tutorial

Marco Codes - Hibernate & JPA Tutorial
Crash course in Hibernate and JPA
Generate tests for generic functions

tip

Generate tests for generic functions
Use a shortcut to generate test files for your generic functions.
Integrated Go Playground

tip

Integrated Go Playground
You can format and share your code, change the Go version, and run your code using the Go playground server.
Merge/Unmerge If Statements

tip

Merge/Unmerge If Statements
Experiment with your code without changing the semantics
Marco Codes - JUnit 5

tutorial

Marco Codes - JUnit 5
JUnit 5 Nice n Easy
Fuzz testing

tip

Fuzz testing
Automate your tests by continuously submitting various input.
React, TypeScript, and TDD

tutorial

React, TypeScript, and TDD
How to write React applications in TypeScript using TDD, highlighting features of the IDE
Using the Terminal in IntelliJ IDEA

tutorial

Using the Terminal in IntelliJ IDEA
IntelliJ IDEA has a built-in terminal that you can use to perform a number of functions inside your IDE
Migrating JUnit 4 to JUnit 5

tutorial

Migrating JUnit 4 to JUnit 5
Migrating your JUnit 4 test suite to JUnit 5
Continuous Testing

tip

Continuous Testing
Run your tests in the background, while you code.
Hot Spots

tip

Hot Spots
Find areas of your code base that may need better test coverage.
Generate Test Methods

tip

Generate Test Methods
Generate a test method in your Test class
Detect incorrect usages of t/b.Fatal* calls in goroutines

tip

Detect incorrect usages of t/b.Fatal* calls in goroutines
Find if tests or benchmarks are using t/b.Fatal* calls inside goroutines incorrectly
Writing Tests with Spock

tutorial

Writing Tests with Spock
Learn about the Spock testing framework by creating a project that uses Spock to unit test Java code
Data Tables

Part of tutorial

Data Tables
Data tables offer the same functionality as data pipes, but this syntax can sometimes be more readable for more complex sets of data.
Given, When and Then

Part of tutorial

Given, When and Then
See how Spock tests are usually structured.
Expecting Exceptions

Part of tutorial

Expecting Exceptions
Tests don't check just the happy paths, sometimes we want to say we're expecting a specific Exception.
Data Pipes

Part of tutorial

Data Pipes
Often we want to test the same set of criteria with different sets of data. Data pipes is one mechanism to do this.
Setting up the Dependencies

Part of tutorial

Setting up the Dependencies
Add Spock framework dependencies to the project
Setup and Teardown

Part of tutorial

Setup and Teardown
See how to set up, or clean up, test classes and methods in Spock.
Mocks

Part of tutorial

Mocks
Mocks are a useful testing tool. We can provide "empty" objects, so we don't have to initialise the whole application to test a section, and we can use mocks to check our code is making the calls we expect.
Verify All

Part of tutorial

Verify All
Test frameworks often stop the test at the first failure. Find out how to run all conditions to see which pass and which fail.
Stubs

Part of tutorial

Stubs
Stub objects allow us to state from a test what values get injected into our application code. They can provide simple interfaces, so we don't have to initialise the whole application to test a section.
Writing and Running Unit Tests with ReSharper

Part of tutorial

Writing and Running Unit Tests with ReSharper
Run, debug and profile tests, do continuous testing, and inspect code coverage.
Assert That Import

tip

Assert That Import
Use quick intentions to manage imports
Writing JUnit 5 Tests

tutorial

Writing JUnit 5 Tests
Writing JUnit 5 Tests
Assert completion in testify

tip

Assert completion in testify
Write testify asserts faster thanks to the IDE smartness
Live Template to create a for loop in benchmark functions

tip

Live Template to create a for loop in benchmark functions
Benchmark loops are repetitive, so let the IDE handle this for you
Live Template to create test function

tip

Live Template to create test function
Write tests faster thanks to the builtin func Test live template.
Live Template to write benchmark function

tip

Live Template to write benchmark function
Write benchmarks quicker thanks to the builtin bench live template.
Navigate to subtests in table tests

tip

Navigate to subtests in table tests
Jump to the specific test case from the results window
Run a single test from a table test

tip

Run a single test from a table test
Focus your testing on new test cases or tests that fail
Completion for testify test names

tip

Completion for testify test names
Let your IDE add constructor arguments to your instance.
Testing code

Part of tutorial

Testing code
Get started with testing. We will use Jest as an example.
Auto-Run Tests

tip

Auto-Run Tests
Get into testing mode by telling GoLand to automatically re-run tests as you type.
Run Single Test

tip

Run Single Test
Speed up testing by focusing on one test.
Spot Coverage Gaps Using the Gutter

tip

Spot Coverage Gaps Using the Gutter
Let the IDE help you spot coverage gaps in your testing.
Run Tests from Editor

tip

Run Tests from Editor
Learn how to run a single test right from the editor.
Unit Testing with Rider

Part of tutorial

Unit Testing with Rider
Learn how Rider can help make sure code behaves as expected, with continuous testing and code coverage.
Review Errors from Test Runners

tip

Review Errors from Test Runners
In a test file, hover over an error to get more information about it.
Visual Testing with pytest

tutorial

Visual Testing with pytest
Test writing is productive and fun with PyCharm as a visual testing tool atop pytest.
Background on Testing

Part of tutorial

Background on Testing
Introduce testing, pytest, and how it all fits into PyCharm, along with a scenario to work on.
Test Fixtures

Part of tutorial

Test Fixtures
Make your tests more focused by moving sample data to pytest fixtures.
Jump to Error

Part of tutorial

Jump to Error
Writing code means writing broken code. Click a link in a traceback to open a file on the line of the error.
Project Setup

Part of tutorial

Project Setup
Make a PyCharm project and virtual environment with dependencies, then configure PyCharm to use pytest.
Skipping Tests

Part of tutorial

Skipping Tests
During refactoring, use pytest's markers to ignore certain breaking tests.
Hello Test

Part of tutorial

Hello Test
Write a simple test and run it in PyCharm's visual test runner.
Debugging During Testing

Part of tutorial

Debugging During Testing
When writing tests, use the PyCharm "visual debugger" to interactively poke around in the context of a problem.
Testing Exceptions

Part of tutorial

Testing Exceptions
Write tests which ensure exceptions are raised when expected.
Getting Into the TDD Flow

Part of tutorial

Getting Into the TDD Flow
Setup your PyCharm project to help get into the flow of Test-Driven Development (TDD).
Finding Tests in Large Test Files

tip

Finding Tests in Large Test Files
Use the Structure tool window for quick navigation around large test files.
Navigate to Test

tip

Navigate to Test
Use the Go to Symbol popup to go to a test.
Speed Up Coverage with Configuration File

tip

Speed Up Coverage with Configuration File
Speed up your "visual coverage" with a config file and correct working directory.
Spot Coverage Gaps Using the Gutter

tip

Spot Coverage Gaps Using the Gutter
Let the IDE help you spot coverage gaps in your testing.
Split Screen Without Tabs

tip

Split Screen Without Tabs
Get your code and tests side-by-side without resorting to tabs.
Auto-Run Tests

tip

Auto-Run Tests
Get into testing mode by telling PyCharm to automatically re-run tests as you type.
Run Single Test

tip

Run Single Test
Speed up testing by focusing on one test.