5
votes
1answer
172 views

Unit testing - External vs Internal dependencies

Unit tests should be isolated, automated ( ie we don't need to do any prior-configuration for all tests to run at the click of a button ) and consistent in their results. For these reasons we should ...
4
votes
5answers
251 views

Are there any cases when one should not use Test Driven Development? [duplicate]

Is it recommended that TDD be always practiced in a project, or are there cases when it should be avoided? Should we all adopt TDD? Is it standard practice in major software companies?
2
votes
3answers
209 views

how and should I 'unit test' an entire package?

I'm still learning to be good about doing unit level testing, as I've always been a little sloppy about only doing functional testing in the past, so I want to double check I'm doing this 'right'. I ...
0
votes
2answers
104 views

Characterization in Testing: Unit test or Functional test [duplicate]

So I'm trying to push for more automated testing in my company, which focus a lot on prototype and proof of concept systems. We currently use Google Test for unit testing. This tests specific test ...
1
vote
1answer
103 views

How to introduce testing in the development cycle

In our company, we are only two IT staffs, and I'm the only developper. I'm developping rich intranet applications using plain php and extjs as javascript framework. Our development cycle is usually ...
6
votes
3answers
341 views

Are “Stocks” a TDD/Unit testing anti pattern?

From Martin Fowler's Mocks Aren't Stubs he states that Stubs provide canned answers to calls made during the test while Mocks objects pre-programmed with expectations which form a specification of the ...
0
votes
1answer
89 views

How should I test my application? [closed]

I have made a simple application which searches for files and folders on users computer. Since, I am a student currently in my 1st year and don't have any formal training and have made my application ...
26
votes
7answers
2k views

Is it sufficient to use acceptance and integration tests instead of unit test?

Short introduction to this question. I have used now TDD and lately BDD for over one year now. I use techniques like mocking to make writing my tests more efficiently. Lately I have started a ...
2
votes
1answer
121 views

How can I automatically test a large, complex spreadsheet?

So, I've inherited one of those "Engineer's Special" spreadsheets -- the kind developed by Mort the Engineer, with lots of hairy VBA and WTF, complicated calculations, and no documentation. ...
3
votes
1answer
97 views

Testing: Should I wrap system notifications and send my own?

In the current Cocoa app I'm working on, I've got an object, RecordScheduler, which responds to two types of notifications, "day did pass" and "quicksaving interval did pass". In both cases, the ...
5
votes
1answer
155 views

Managing false positives in TDD or BDD

I'm relatively new to TDD and have been thinking a lot about how to manage the perpetually growing pool of tests that comes with it. One of my biggest concerns is about false positives. In my ...
0
votes
1answer
122 views

How would you create useful tests for Oracle BI Publisher reports?

I'm curious about how to test reports that seem rather straightforward. I'm supposed to create test cases for an Oracle report(XML Publisher/BI Publisher). So for example, a report is supposed to just ...
1
vote
1answer
290 views

Unit Testing Wrapper (Facade?) Method

I have to write unit tests for some classes my group is developing. The classes are fairly simple, and I'm not sure how to best test them. public class MyObjectRegistry { private ...
20
votes
2answers
586 views

How do I create an environment where fixing tests is seen as a priority?

I am a software engineer at a medium sized company. We have a fairly robust testing platform running on TeamCity. It does unit tests on every checkin, and a daily unit test/BVT run. The problem is ...
0
votes
2answers
78 views

Area of testing

I'm trying to understand which part of my code I should to test. I have some code. Below is example of this code, just to understand the idea. Depends of some parametrs I put one or another currency ...
0
votes
1answer
75 views

Test Doubles : Do they go in “source packages” or “test packages”?

I've got a couple of data access objects (DefaultPersonServices.class, DefaultAddressServices.class) which is responsible for various CRUD operations in a database. A few different classes use these ...
1
vote
1answer
657 views

How to create unit/integration tests for my web app?

I am currently developing an Ajax chat application that uses PHP on the back-end. Some of the features it has right now are different types of users (admin/mod/banned), public and private rooms, ...
3
votes
4answers
375 views

Test Driven Development: A good/accepted way to test file system operations?

I am working on a project at the moment that generates a table (among other things) based on the contents of a file-system, and and in turn does some meta-data modifications on the things it finds. ...
2
votes
1answer
149 views

Rethinking testing strategy

Working on Plone projects our team tries to achieve full test coverage at least for important products. The kind of tests we write are unit tests, functional tests and integration tests. (Also ...
1
vote
2answers
138 views

Understanding unit testing for dynamically changing condition

I was trying to understand how to write unit tests for a few days now. I'm confused with following scenarios in the existing code. In first function the max value changes depending on the object ...
-1
votes
4answers
163 views

How to use unit testing? [duplicate]

How to use unit testing? There are a lot of frameworks for different languages, which provide functionality of unit testing. There is a lot of information on how to use each of them technically. Just ...
8
votes
3answers
375 views

Doesn't single-assert unit testing break the DRY principle?

Whenever I write unit tests I have always tried to have a single assert per test to make debugging easier when tests fail. However as I follow this rule I feel like I am constantly copying the same ...
2
votes
2answers
417 views

Should I bother to write unit test for UI/UX Components?

So I am building an application with Angular and have started to get into UI testing with DalekJS (http://dalekjs.com). As I have been writing these tests I have been thinking to myself, should I ...
2
votes
2answers
354 views

Unit Tests work but there are still bugs?

Brief History I am new to Automated Unit Testing and Mocking objects world; previously we used to do Unit Testing (including Integration Testing and we mistakenly referred that as Unit Testing) ...
6
votes
4answers
459 views

I have 200k lines of poorly designed code, will units tests or integration tests be more valuable? [duplicate]

I've inherited a lot of poorly designed code; the code has no tests. I am putting tests in place before I attempt a major refactor, but I have run into a problem with my unit tests. The problem is, I ...
6
votes
5answers
687 views

Do I need unit test if I already have integration test?

If I already have integration test for my program, and they all passed, then I have a good feel that it will work. Then what are the reasons to write/add unit tests? Since I already have to write ...
46
votes
6answers
4k views

65.000.000.000 tests to run

I was asked about how to run a suite of 65.000.000.000 tests and I wonder if it is normal to have a project with such a huge amount of tests. Have you worked in projects with this characteristic?
3
votes
1answer
124 views

calling test methods within other test methods

To test a method that returns a clone of the object it is called on, i need to re-run the test suite on the newly created object if i am to ensure that full functionality is retained, i found my ...
5
votes
2answers
419 views

Unit test SHA256 wrapper queries

I have the following SHA256 wrapper. public static string SHA256(string plainText) { StringBuilder sb = new StringBuilder(); SHA256CryptoServiceProvider provider = new ...
1
vote
1answer
91 views

How can I test linkable/executable files that require re-hosting or retargeting?

Due to data protection, I cannot discuss fine details of the work itself so apologies PROBLEM CASE Sometimes my software projects require merging/integration with third party (customer or other ...
1
vote
4answers
819 views

Unit-Testing functions which have parameters of classes where source code is not accessible

Relating to this question, I have another question regarding unit testing functions in the utility classes: Assume you have function signatures like this: public function void ...
3
votes
5answers
227 views

Testing From A Developer's Perspective [closed]

I have a book which mentions: "There are many types of testing, including unit testing, integration testing, functional testing, system testing, performance testing, and acceptance testing". It ...
2
votes
1answer
112 views

Testing MVC models when using SQL referential constraints

I have an MVC web app that's wired against PostgreSQL. The DB uses the full gamut of various referential constraints to ensure referential integrity, as opposed to say the Rails approach, where you ...
0
votes
2answers
253 views

How can a non-developer help promote/develop unit tests? [duplicate]

After some discussions with folks on the testing/QA side of our company, we're of the opinion that better unit-level testing by developers would greatly reduce bugs and issues and help development ...
57
votes
11answers
6k views

Is it a bad practice to modify code strictly for testing purposes

I have a debate with a programmer colleague about whether it is a good or bad practice to modify a working piece of code only to make it testable (via unit tests for example). My opinion is that it ...
13
votes
4answers
2k views

Is there a point to unit tests that stub and mock everything public?

When doing unit tests the "proper" way, i.e. stubbing every public call and return preset values or mocks, I feel like I'm not actually testing anything. I'm literally looking at my code and creating ...
3
votes
1answer
167 views

Shared context: good or bad?

RSpec allows users to share context across tests / examples, which would reduce the number of code lines in my app by a significant amount. On the other hand, somehow related to the question of ...
3
votes
6answers
447 views

Why don't I see many unit test projects that bring up and tear down a DB? (ASP.NET MVC)

I see all the examples that demonstrate unit testing code and mocking the calls to the DB since you are not suppose to touch the DB. But it seems to me having a set up tasks that uses the actually ...
3
votes
1answer
318 views

How to keep unit tests independent?

I've read it at many places that unit tests should be independent. In my case I have a class that does data transformation. These steps must be done sequentially, otherwise they don't make sense. For ...
3
votes
1answer
134 views

Unit Testing and “Fit”

I am reading Cristopher Alexander's "Notes on the Synthesis of Form", and he is describing a solution to a problem as having good fit, when there is an absence of bad fit; we can't describe all of the ...
3
votes
5answers
2k views

Understanding unit tests/TDD for ASP.NET webforms [closed]

I'm the lead programmer at a small software firm (currently 4 developers including myself), we develop bespoke ASP.NET WebForms applications for businesses. I joined there in 2010 just after ...
4
votes
1answer
5k views

How can I unit-test my REST web service?

I am new to unit testing, I've one REST web method that just calls DB and populates a DTO. Pseudo code is public object GetCustomer(int id) { CustomerDTO objCust = //get from DB return objCust; } ...
5
votes
3answers
608 views

In TDD, if I write a test case that passes without modifying production code, what does that mean?

These are Robert C. Martin's rules for TDD: You are not allowed to write any production code unless it is to make a failing unit test pass. You are not allowed to write any more of a unit test than ...
13
votes
3answers
804 views

Brittle unit tests due to need for excessive mocking

I've been struggling with an increasingly annoying problem regarding our unit tests that we are implementing in my team. We are attempting to add unit tests into legacy code that wasn't well designed ...
7
votes
1answer
415 views

Unit testing in Django

I'm really struggling to write effective unit tests for a large Django project. I have reasonably good test coverage, but I've come to realize that the tests I've been writing are definitely ...
68
votes
11answers
6k views

Is there a reason that tests aren't written inline with the code that they test?

I've been reading a bit about Literate Programming recently, and it got me thinking... Well-written tests, especially BDD-style specs can do a better job at explaining what code does than prose does, ...
5
votes
2answers
1k views

Event Driven Programming: A sequence of unfortunate events

I have a very basic game loop whose primary purpose is to check for updates & changes to a list. I have contemplated using event driven programming to replace the game loop/list idea with an ...
8
votes
3answers
569 views

Relative value of manual vs automated testing

The organisation I work for has recently employed a testing officer to run manual tests, but when I asked about being given time as a developer to write unit tests the response was that the manual ...
6
votes
2answers
751 views

Helper static methods in TDD

I am creating an application which will be testable(unit + integration). In this application I have a FileHelper static class, public static class FileHelper { public static void ...
4
votes
5answers
2k views

Is path coverage stronger than condition coverage?

I have encountered (even in literature) two contradicting opinions related to path vs condition coverage (not branch or edge!). Some say Path coverage is stronger than the condition coverage, some say ...