Linting
beginnerDefinition
Automatic proofreading for code. A linter scans through the source files and flags stylistic mistakes, suspicious patterns, and likely bugs: without actually running the code. It catches the small problems early, before they reach reviewers or tests.
In the wild
A developer leaves a stray bit of leftover debug code in a file before pushing it. The linter notices it during the team's automatic check, marks the line, and tells him to remove it. The cleanup happens before any teammate ever sees the messy code.
More from Testing & Quality
Assertion
A statement inside a test that says 'I expect this to be true.' If the expectation is wrong, the test fails and tells you exactly what didn't match. Assertions are how a test actually checks that the code is doing what it's supposed to.
End-to-End (E2E) Test
A test that drives the whole app from the outside, just like a real person would: clicking buttons, filling out forms, going from one page to the next. It's the most realistic kind of test (it catches problems no other test would), but also the slowest and the most easily upset by little changes.
Fixture
A pre-prepared piece of fake data that tests can rely on: like a sample user, a stock list of products, or a saved response. Using the same fixture across many tests keeps them tidy and consistent, instead of every test inventing its own slightly different sample.
Flaky Test
A test that sometimes passes and sometimes fails for no clear reason: usually because it depends on something it shouldn't, like the time of day, the order other tests ran in, or how fast the network is responding. Flaky tests slowly destroy the team's trust in the whole test suite.
Integration Test
A test that checks whether several pieces of an app work correctly when they're put together: talking to a real database, hitting a real internal service, the way they would in real life. It catches the kinds of bugs that only show up when separate pieces have to cooperate.
Mock
A pretend version of something the code normally talks to, a database, an email service, a payment processor, used during tests. The mock behaves the way the test wants and quietly records what the code asked it to do, so the test can check that the right things happened.