The terms "brittle" and "fragile" do not have a clear and specific definition within the context of software development. Rather, they are ordinary English words that are sometimes used in software development to describe certain kinds of code.
In the context of software development, these words mean exactly the same thing as they do everywhere else: "brittle" and "fragile" things are things that are easy to break.
That said, there is this "personal reflection essay" from Wikipedia. If you're looking for an "official" definition, this one is as good as any:
Software brittleness is the increased difficulty in fixing older software that may appear reliable, but fails badly when presented with unusual data or altered in a seemingly minor way.
Things that make unit tests brittle:
- Asserting against elements in a UI.
- Asserting against large result strings instead of discrete values.
- Static state or improper state sharing between threads.
- Unrealistic or otherwise inadequate test data.
- Elaborate mocking schemes.
- Brittle code under test.
- Too many edge cases or unreasonably high cyclomatic complexity.
- Too many responsibilities.
- Leaky abstractions.
- Code under test is not idempotent between test sessions.
- Tests whose results can vary based on the environment, such as performance timings.
- Tests that can't run independently of each other.
As you can see, what makes unit tests fragile is often not the fault of the test, but the fault of the code being tested.
One way to have better tests (and by extension, better code), is to practice Test-First Development. Writing your tests first forces you to think about the surface area of your code's API, and strongly encourages you to write that surface area in a way that makes it simpler, more robust, more deterministic and easier to test.
The Brittleness of Unit Tests
Some Good Advice for Newcomers to Unit Testing