Unit testing is a method by which individual units of source code are tested to determine if they are fit for use.
3
votes
1answer
46 views
What to test when building websites using CMS?
My job is mainly building websites using CMS such as Drupal, eZPublish or Magento.
Most of the work is templating, CRUD and adhering to the specs with this. Occasionally, there is some ...
26
votes
7answers
1k views
Writing Tests for Existing Code
Suppose one had a relatively large program (say 900k SLOC in C#), all commented/documented thoroughly, well organized and working well. The entire code base was written by a single senior developer ...
0
votes
0answers
113 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 ...
1
vote
2answers
241 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) ...
5
votes
6answers
304 views
Unit-Tests and databases: At which point do I actually connect to the database?
There are answers to the question on how test classes that connect to a database, e.g. "Should service test classes connect ..." and "Unit testing - Database coupled app".
So, in short let's assume ...
2
votes
2answers
136 views
Unit testing and coupling
As a developer I should strive for low coupling between classes.
But low coupling doesn't mean "No coupling" so sometimes I have to allow some code flexibility and use "new" inside a domain model. ...
6
votes
4answers
355 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 ...
3
votes
2answers
67 views
Unit test strategy for layered (or derived) method calls
Forgive the title -- it needs work. I am struggling to find better English to express my issue. Edits encouraged.
Example to describe my issue:
Checker Method
I have an argument checking method ...
0
votes
1answer
46 views
Unit testing in node.js and mocking modules
I'm trying to test this wrapper to request that I made:
// lib/http-client.js
var app = require('app'),
request = require('request');
exports.search = function(searchTerm, next) {
var options ...
1
vote
3answers
283 views
Does non-virtual-by-default lead us to composition-over-inheritance?
There are some design guidelines about testable code in “The Art of Unit Testing”. The first one is “Make methods virtual by default”. I’m curious to know your idea about non-virtual-by-default ...
1
vote
1answer
172 views
TDD / one test representing the whole scenario ? or should I split it? [duplicate]
While practicing TDD, I came across this specification:
A user should be created with its password hashed, be persisted and an activation token should be returned.
Should my first unit test, (aiming ...
1
vote
1answer
219 views
Should we mock entities and value objects when doing DDD?
After reading a few articles about Newable vs Injectable objects and how these concepts relate to DDD's services, entities and value objects, I was left with some doubts about using newables in my ...
0
votes
1answer
123 views
Is it worth writing a unit test for a DTO with the most basic getter/setters? [duplicate]
The advantage is it protects your DTO against future "enhancements" ?
-1
votes
0answers
55 views
I'm a complete newb to unit testing: how do I do them? [duplicate]
When I program, I just write down code that does the job. I (and my users) find bugs: I fix them. Then I heard about unit testing: it helps me find bugs more easily. However, I've never done it ...
4
votes
5answers
248 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 ...