Verifying the behavior of a software system against the expected behavior of that system.

learn more… | top users | synonyms

1
vote
3answers
44 views

Are debug-build-only UI controls a bad practice?

Often, to simplify testing, I add UI controls that are only visible and enabled in debug build only. Or prepopulate mandatory input fields in debug build. Is this a bad practice? Assuming the release ...
0
votes
1answer
22 views

How to write tests for browser automation script

I have a couple of scripts (two in Python, one in Java) that use Selenium to drive a browser and download files from a website. I need to do some major refactoring before I do a major expansion, so I ...
2
votes
3answers
126 views

Unit Testing and 3rd party packages. Do I mock or not?

I'm just getting used to unit testing and on my new project I decided to adopt a TDD approach. My code below is to test the UserServices class which is responsible for creating a user, deleting a ...
5
votes
2answers
225 views

Report test failures “all at once”, or report them one by one

I am a sole developer working for an organisation that has no testing strategy. I am trying to integrate a crime system developed by a vendor with an external application I developed. The external ...
-2
votes
3answers
143 views

What is the most elemental workflow for TDD?

Gradle is such an interesting build tool that it prompted me to look at Spock and JUnit -- which I've never done before. What is the basic workflow with TDD? My approach has been to do frequent ...
-2
votes
1answer
99 views

What do developers do during testing phase of a waterfall life cycle? [closed]

If the testing phase is over 5 months long do the developers help the testers execute scripts? I don't know how it's done in a waterfall lifecycle where the phases are usually quite long.
4
votes
3answers
86 views

Unit Testing Module-Internal Functions

I'm writing a simple whitebox unit testing suite for a project I'm working on in C. The project is broken into modules (each has a .c file with an associated .h file), and all modules are compiled ...
0
votes
0answers
25 views

Test architecture for feature that spans several modules

We have several modules that handle various parts of an incoming message. Each module does some unrelated work on the message (for example, write to the DB; send to the client), and all modules are ...
3
votes
2answers
108 views

What is it called when you test a microservice by mocking the dependencies?

I've a RESTFul microservice written in Grails. This microservice has it's own DB. It also depends on two other microservices. A typical workflow of the service is: Receives a GET request from a ...
2
votes
4answers
137 views

Cleanup & Arrange practices during unit testing to avoid dirty databases

I'm coding UnitTest in C# and I settled with this structure: try { // ========== // ARRANGE // ========== // Insert into the database all test data I'll need during the test // ...
76
votes
9answers
8k views

What's the point of running unit tests on a CI server?

Why would you run unit tests on a CI server? Surely, by the time something gets committed to master, a developer has already run all the unit tests before and fixed any errors that might've occurred ...
0
votes
0answers
29 views

Testing Browser/OS combinations

We support IE9, IE10, IE11, Chrome and Firefox, and we support them on Win7, Win8, Win8, and Win10. If we tested every possible combination of browser and OS that would be 20 times through our script ...
0
votes
3answers
110 views

At what point in a projects life-cycle do you begin writing tests? [duplicate]

I'm not in the field, so I don't have any professional experience from projects following the TDD design. I am trying to adopt this pattern, but I'm confused as to when I start actually writing the ...
3
votes
3answers
118 views

How do you test a selenium framework?

I have a very large selenium test framework I use to test a web application. It it built around a page-object pattern. This week I fixed a bug in a low level piece of the framework, but it broke many ...
1
vote
0answers
31 views

How can I test for performance issues in a specific piece of code? [duplicate]

I've inherited a problem from a programmer that isn't with our group anymore - a piece of our application suffers from performance issues under a particular set of circumstances. I can replicate ...
1
vote
2answers
67 views

how to unit test constant that define an implementation detail?

How do I unit test a constant that define an implementation detail? and should I? For instance let's say I have the following class: class A { private Cache _cache; const int ...
2
votes
2answers
104 views

How unit test service method that use repository method

For service methods that call repository methods to interact with database how could I unit test these service methods? For example, public function updateSlideshow($data){ // do some logic ...
3
votes
0answers
100 views

Is there a simpler way to help testers push code to a testing branch?

I'm a amateur programmer, I'm not used to working with Git. It's my job to help test new code, for a while now this has included pulling the branch containing the issue, merging it with the main ...
4
votes
3answers
162 views

How narrow should my unit tests be?

Here's an example: I have a chat module in my app, and there's a ChatService class that is responsible for networking, and there's a ChatNotificationService helper class that is responsible for ...
5
votes
1answer
81 views

Strategies to maintain contract between mocks and APIs

Using a mock instead of hitting a 3rd party API like Postgres or Stripe can often be necessary when writing tests. A problem I've seen is when the API can unknowingly diverges from the data the mocks ...
5
votes
1answer
90 views

Unit testing an API client and wrappers

I've been going round in circles trying to figure out the best way to unit test an API client library I'm developing. The library has a Client class which basically has a 1:1 mapping with the API, and ...
2
votes
2answers
49 views

Acceptance testing with preloaded data or filling it on the go

We're figuring out whether we should write acceptance tests that revolves around preloaded data on a database file, or programmatically added needed data per test, or filling database while testing ...
5
votes
5answers
349 views

Can we add methods which is easier for assertion in test and which is only used in tests when TDD?

Here let me take a simple parking boy example. A parking boy can manage several parking lots, and when a car comes, he will park the car into some parking lot and can also help to un-park the car. ...
-1
votes
2answers
116 views

What technique can I use to test my code when code renders out an untestable(?) PDF document?

I have a need to test output of my code before I send the output for PDF rendering. Currently I have decided on a switch statement that does two different things depending on whether I am in ...
3
votes
1answer
112 views

What percentage of failed requests is “normal” [closed]

So I just launched my first "real" site that actually has a decent amount of interactions and whatnot. It's an ASP.net site with a SQL backend. We've served 130k requests in the last 12 hours but ...
5
votes
3answers
113 views

Stubbing Properties with private setters for tests

We have the object public class MyObject{ protected MyObject(){} public string Property1 {get;private set;} public string Property2 {get;private set;} public string Property3 ...
5
votes
6answers
540 views

Is it an overkill to write unit tests for a small code base? [duplicate]

I am the sole maintainer of a code base of about 2000 lines of code. It's not big, but over time the code became so unmaintainable my boss agreed to give me time to rewrite it from scratch. Since the ...
2
votes
0answers
49 views

What's the best way of testing client/server programs using Bamboo?

At my company, we've standardized on Bamboo for continuous integration. One of our products is a Server + a set of clients, and we want to test many different combinations. The way we do it is to have ...
10
votes
6answers
728 views

Why do we need both Priority and Severity?

I understand what they determine but is it really useful to assign those to issues found? I mean, it is either required to fixed quickly or not. I know how to set them, categorize them etc. I know ...
8
votes
1answer
1k views

Refactoring byzantine payment processing code on a limited budget [closed]

I've been working on a large Ruby on Rails application for several years. It was inherited in a poor state but most of the production bugs have been ironed out with time. There are some sections that ...
2
votes
4answers
135 views

Is it ok to use service locator for ubiquitously used dependencies? [closed]

We strictly adhere to inversion of control in our codebase, but that creates hellish constructors (yes, I know that means our classes aren't cohesive enough, this is a work in progress). The thing is, ...
5
votes
1answer
122 views

Strategies to increasing the maintainability of assertions in code [closed]

Background I am writing a compiler for a custom language for a school project and it is going really well for me. If I where to start all over from scratch I would have done many software ...
5
votes
1answer
116 views

Testing procedural code

TL;DR. Writing procedural code within a DB transaction. How can I improve design of the code so it's better testable? In my application I have a service object that perform multiple things within the ...
3
votes
3answers
125 views

Should defects be raised during sprints or just noted in the stories and assigned to developers?

I have heard that when testing stories developed in the current sprint, no issues are raised they are not completed (i.e. definition of done was not fulfilled) and that you should only raise issues ...
0
votes
1answer
98 views

How to write unit tests for an application that mostly performs “hard to test” actions? [duplicate]

In my company we develop medical data-acquisition systems. The main functions of each application are: Interface with data-sampling hardware; Save/load collected data to/from files on disk; Perform ...
48
votes
15answers
5k views

Almost every reported bug is a high-priority bug [closed]

I have noticed a pattern while working on several software projects: the big majority of the bugs reported had a high/very-high priority. I asked some colleagues about why this may be happening, and ...
1
vote
0answers
24 views

Do the terms “unit test” and “integration test” sometimes overlap or conflict? [duplicate]

By my understanding, a "unit test" is a test that makes assertions about the "smallest testable unit" - and an "integration test" is a test that depends on integration with an external system, e.g. ...
1
vote
1answer
84 views

Testing base-62 converter

I have a converter module which encodes non-negative numerics to base 62 strings and vice versa. I'm not very experienced with testing, and I got this so far: Encode Test for negative numbers Test ...
0
votes
1answer
55 views

Does testing the characteristics of a runtime have a generally accepted name? [closed]

I am working with PowerShell which doesn't seem to have an up-to-date language spec. This leaves me wondering about some edge cases. I've taken to testing my assumptions about how PowerShell's ...
0
votes
0answers
29 views

Is there value is putting test/build outputs under source control?

My colleagues insist on ploughing every bit of output data they can into subversion. I can't see the value in this practice and would much rather use a file system. The key offenders are build and ...
67
votes
9answers
6k views

Are (database) integration tests bad?

Some people maintain that integration tests are all kinds of bad and wrong - everything must be unit-tested, which means you have to mock dependencies; an option which, for various reasons, I'm not ...
1
vote
3answers
154 views

Is a logical error always caused by the line of code for the earliest program state which is wrong? [closed]

A logical error, contrary to a fatal runtime error, is a run time error which doesn't fatally terminate a program, but does something not intended. Is a logical error necessarily caused by the line ...
1
vote
2answers
244 views

Should I unit test my subclasses or my abstract parent class?

I have a skeletal implementation, as in Item 18 from Effective Java (extended discussion here). It is an abstract class that provides 2 public methods methodA() and methodB() that call subclasses ...
7
votes
2answers
251 views

Can I check the existence of an annotation in an unit test?

I have a java class hierarchy that are formed by an Abstract class and N extensions of it. In the abstract class I have a method that is annotated with a @Remove annotation. While we won't get any ...
4
votes
1answer
73 views

Testing of a layered software architecture

I am currently building an application with a layered architecture in C. Currently, I have built and tested the bottom layer, which is a networking module, providing functionality such as ...
1
vote
1answer
47 views

What is the preferred way of preparing data in automatic testing

Lets say I want to test a method of a class representing a user account. I have a fixture which contains several user records from which I want to choose one. What is the preferred method here? Pick ...
4
votes
5answers
163 views

Include Testers inside the Team or Create a Tests Area? [closed]

I've become a leader of a group of 30 developers. We run Scrum and we have different teams for each Product Backlog. We have no testers across the teams and I'd like add them. My main question is: ...
1
vote
2answers
139 views

Ways of creating expected object for assert

Recently, I started to use TDD. It's really cool and fun but creating expected object for assertEquals is very boring and tedious. At the moment I see only two way for that: Straightforward Creating ...
1
vote
1answer
118 views

How does branch coverage handle loops?

I know how code coverage works in general, and I know what branch coverage is. But I can not seem to find an explanation for how branch coverage handles loops. Does it work like path coverage? Where ...
174
votes
9answers
16k views

Is it normal to spend as much, if not more, time writing tests than actual code?

I find tests a lot trickier and harder to write than the actual code they are testing. It's not unusual for me to spend more time writing the test than the code it is testing. Is that normal or am I ...