tests (1,819)


sql server - How do I unit test persistence?

sql server - How do I unit test persistence?

As a novice in practicing test-driven development, I often end up in a quandary as to how to unit test persistence to a database. I know that technically this would be an integration test(not a unit…


unit testing - How to make junior programmers write tests?

We have a junior programmer that simply doesn't write enough tests. I have to nag him every two hours, "have you written tests?" We've tried: Showing that the design becomes simpler Showing it prevent…


unit testing - What is the difference between integration and unit tests?

I know the so-called textbook definition of unit tests and integration tests. What I am curious about is when it is time to write unit tests... I will write them to cover as many sets of classes as po…


Unit tests for deep cloning

Let's say I have a complex.NET class, with lots of arrays and other class object members. I need to be able to generate a deep clone of this object-so I write a Clone() method, and implement it w…


testing - Anyone Using Executable Requirements?

In my limited experience with them executable requirements(i.e. specifying all requirements as broken automated tests) have proven to be amazingly successful. I've worked on one project in which we…


Getting Started with Unit Testing

Unit testing is, roughly speaking, testing bits of your code in isolation with test code. The immediate advantages that come to mind are: Running the tests becomes automate-able and repeatable You…


Refactoring for Testability on an existing system

I've joined a team that works on a product. This product has been around for ~5 years or so, and uses ASP.NET WebForms. Its original architecture has faded over time, and things have become relativel…


unit testing - Random data in Unit Tests?

I have a coworker who writes unit tests for objects which fill their fields with random data. His reason is that it gives a wider range of testing, since it will test a lot of different values, wherea…


How do you generate dynamic(parametrized) unit tests in python?

I have some kind of test data and want to create a unit test for each item. My first idea was to do it like this: import unittest l=[["foo", "a", "a",],["bar", "a", "b"],["lee", "b", "b"]] class…



How would you test observers with rSpec in a Ruby on Rails application?

Suppose you have an ActiveRecord::Observer in one of your Ruby on Rails applications-how do you test this observer with rSpec?…




test run unit testing how not example tutorial junit for