Reading notes "test driver development"

zhaozj2021-02-16  61

After read the

Let me make a conclusion.

All the theory can be be express by some q & a

Part I ---------------------------------------------------------------------------------------------------------------------------------------------------- ----------------

Q: How do you test your software?

A: Write an Automated Test.

Q: Howings The Running of Tests Affect One ANOTHER:

A: NOT AT ALL.

Q: What shop you test?

A: Before You Begin, Write a List All The Tests You Know You Will Have to Write.

Q: When Should You Write you test?

A: Before You Write The Code That Is To Be Tested.

Q: When Should you write the asserts?

A: Try Writing Them First.

Q: What Data Do you use for test-first tests?

A: use data this makes the tests easy to read and follow. (...)

Q: How do you believent the intent of the data?

A: Include Expected and actual results in the test itself, and try to make their rellationship apparent.

Part II ------------------------------------------------ -----------

Q: Which Test SHOULD You Pick Next from the list?

A: Pick A Test That Will Teach You Something and That You Are Confident You CAN IMPLEMENT.

Q: Which Test Should You Start with?

A: start by Testing a variant of an operation there isn't do anything.

Q: How do you spread the use of automated testing?

A: ask for and give explanations in terms of tests.

Q: WHEN do you write tests for externall product?

A: Before the first fime you are going to use a new facility in the package.

Q: How do you keep a Technical Discussion from straying off topic?

A: WHEN A Tangential Idea Arises, Add A Test To The List and Go Back to The Topic.

Q: What do you do when a defect is reported?

A: Write The Smallst Possible Test Test That Fails and That, ONCE RUN, WILL BE REPAIRED.

Q: What do you do when you are feeling lost?

A: throw away the code and start over.part III (detail) ----------------------------------- -----------------

Q: How do you get a test case running That Turns Out to be too big?

A: Write a Smaller Test Case That Reresents The Broken Part of The Bigger Test Case.

Q: How do you test an Object That Relies ON An Expensive Or Complicated Resource?

A: CREATE A Fake Version of The Resource That Answere Constants.

Q: How do you test what one Object Communicates Correctly with another?

A: Have the object under Communicate with The Test Case Instead of with the object it expect.

Q: How do you test what the SEQUENCE IN WHICH MESSAGES Are Called Is Correct?

A: Keep A Log in a string, and append to the string..

Q: How do you test error code what unlikely to be invoked?

A: Invoke It Anyway Whith a Special Object That Throws An Exception Instead of Doing Real Work.

Q: How do you leave a programing session when're programming alone?

A: Leave The Last Test Broken.

Q: How do you leave a programing session when're programming in a?

A: Leave All of the tests running.

PART IV ------------------------------------------------ ------------

Q: What is your first importation once you have a broble test?

A: Return a constant.

Q: How do you MOST Conservatively Drive Abstract WITH TESTS?

A: Abstract Only When You Have Two or More Example.

Q: How do you usually Simple Operations?

A: Just Implement Them.

Q: How do you implemement an operation That Works with collections of ibjects?

A: Implement IT WITHOUT The Collections First, The Make It Work with Collectes.

-------- End --------

转载请注明原文地址:https://www.9cbs.com/read-21055.html

New Post(0)