Author: Haroon Khalil
-
Introduction
Surely you picked up the because you’re curious about quantum physics and you want to learn about it. Perhaps you’ve heard that some of nature’s smallest particles choose sometimes to behave (or misbehave) like waves. Or perhaps you read that in the quantum realm, cats can be both alive and dead at the same time.…
-
Acknowledgments
Nearly every physicist under the age of 100 will have had, at some point, a quantum physics professor or two. We ourselves have had nine of them along the way. Without their patience and pedagogy, never have been written. We owe a debt of thanks to Bob Delaney, Mohamed Fellah, Tom Gorczyka, Gerald Hardie, Eric…
-
How This Is Organized
Quantum vs. Classical Physics, constitutes a prelude to our main feature. Unlike what you’d see in a movie theater, though, it is not a series of coming attractions. It is more like a prequel to the quantum story. Here we will introduce the way that physics worked—and sometimes didn’t work—before the unexpected emergence of quantum physics.…
-
Why This Is Different
This explains why quantum physics is such a popular subject for popular scientists. There are devoted to its introduction, and many of these are excellent. Nevertheless, the majority of them present the subject either in exclusively conceptual terms that rely on everyday analogies, or by quickly drilling down to the underlying mathematical basis. We have…
-
Introduction
“When you come to a fork in the road, take it!” This sage advice from Yogi Berra revealed that he was not only a great baseball player and humorist, but also a secret quantum physicist. After all, everyday experience tells us that when you come to a fork in the road, you can go in…
-
Sensitive assertions
Good assertions are fundamental in test cases. A bad assertion may result in a test not failing when it should. However, a bad assertion may also cause a test to fail when it should not. Engineering a good assertion statement is challenging—even more so when components produce fragile outputs (outputs that change often). Test code should…
-
Fixtures that are too general
A fixture is the set of input values used to exercise the component under test. As you may have noticed, fixtures are the stars of the test method, as they derive naturally from the test cases we engineer using any of the techniques we have discussed. When testing more complex components, you may need to build several…
-
Bad handling of complex or external resources
Understanding test code that uses external resources can be difficult. The test should ensure that the resource is readily available and prepared for it. The test should also clean up its mess afterward. A common smell is to be optimistic about the external resource. Resource optimism happens when a test assumes that a necessary resource…
-
Unclear assertions
Assertions are the first thing a developer looks at when a test fails. A good assertion clearly reveals its reason for failure, is legible, and is as specific as possible. The test smell emerges when it is hard to understand the assertions or the reason for their failure. There are several reasons for this smell…
-
Excessive duplication
It is not surprising that code duplication can happen in test code since it is widespread in production code. Tests are often similar in structure, as you may have noticed in several of the code examples. We even used parameterized tests to reduce duplication. A less attentive developer may end up writing duplicate code (copy-pasting…