Stack Exchange Network

Stack Exchange network consists of 174 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [testing]

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

1
vote
1answer
11 views

mutation testing relationship with test unit and original code

I have reading about mutation testing and even though its inner functioning or how to do it is clear to me; I am having some troubles to understanding the relationship between a program that wants to ...
0
votes
1answer
79 views

What's the purpose of xfail tests?

Some test frameworks, notably DejaGnu and py.test, have an "XFAIL" flag/status for a test which says that this test is expected to fail. If the test succeeds, it's marked as "XPASS" (unexpected pass). ...
0
votes
3answers
262 views

How do I test unreachable code?

Let's say your company sells software that comes with customizable text, and your team's job is to customize it. The client engagement includes a contract in which the client specifies all of the text ...
0
votes
1answer
56 views

Testing - concise mocks vs asserting received calls

Let's say we have this method: string Add(int a, int b) { var sum = _calculator.Add(a,b); var response = _formatter.Format(sum); return response; } Now I want to unit-test this method. ...
0
votes
2answers
46 views

How to automatically test the result of an ETL tool?

If an ETL tool is being used to move data from an OLTP database into a "business intelligence reporting" database, is there any standard way of automatically testing that the data in the reporting ...
2
votes
2answers
187 views

How to engineer and test mission critical software?

TL;DR: My goal is to create some framework with which I could discover/test all possible internal states of my application so that I would approach with confidence for example engineering software for ...
2
votes
4answers
130 views

Should QA test bugfixes in Dev Environment

I encountered a situation where the dev team suggested that they will push bug fixes to our dev environment rather than to the test environment, and they asked QA to test there first. I am not sure if ...
-1
votes
0answers
119 views

Is it a code smell to expose a public method just for testing purposes? [duplicate]

Is it a code smell if the consumers of a class do not need a particular public method of the said class, but having the method simplifies its testing significantly? Consider the following example: ...
63
votes
6answers
10k views

How exactly should unit tests be written without mocking extensively?

As I understand, the point of unit tests is to test units of code in isolation. This means, that: They should not break by any unrelated code change elsewhere in the codebase. Only one unit test ...
-1
votes
1answer
89 views

Best practices on unit tests for consecutive functions

Let's say we have function A and function B which perform consecutive operations on some data, with B never receiving the data before A processes it. Function A makes exhaustive checks on potential ...
16
votes
7answers
4k views

Is it a good idea to write all possible test cases after transform the team to TDD to achieve a full coverage?

Assume we have a large enterprise-level application without any unit/functional tests. There was no test-driven development process during the development due to very tight deadlines (I know we should ...
-1
votes
1answer
31 views

How do I test my python package (for distributing) for different versions of python?

I have made a small library/application that I intend to distribute. However I want to find out what versions of python can handle my script ? Given that there are many minor and micro versions and ...
-4
votes
0answers
15 views

Validity of Artifacts [duplicate]

So we have this documentation on a system that we are working on and in the section of "Testing, verification and validation", it has a subsection that says "Validity of Artifacts." My question is, ...
-3
votes
1answer
26 views

What is an integration test pattern for an extensible permutation of cases (e.g. dimensions of seed data and filtering by said dimensions)?

Suppose we have a service that returns users in certain categories, e.g. Listens to a certain artist. Listens to a certain playlist. Listens to a certain genre. Is between ages X and Y. Is located in ...
-3
votes
0answers
70 views

Is putting related functions into a stateful class just for testability purposes a code smell?

Take the following JavaScript module as an example of a utility class helper file that exposes many related utility functions. This module initializes the state of module and the exported functions ...
2
votes
2answers
122 views

malloc on different platforms

I am testing a red-black tree implementation (repository) and I find that with Windows 10 and gcc, malloc starts returning NULL after inserting approx. 50 million nodes but on Linux it works at least ...
0
votes
1answer
74 views

Git branching model for teams with develop, test and deploy phases

A developed piece of code goes these phases in our team: Developers write the code Then they send it to testers If tests pass, then testers send the change/new feature/bugfix to operations team for ...
-2
votes
1answer
50 views

Understanding property based testing

I'm reading about property based testing and I'm wondering how can I test this my code using that paradigm. class Invoice { private final String id; private final String companyName; ...
0
votes
1answer
123 views

Is this wrapper class too simple to test?

I have a following class in my PHP code: <?php declare(strict_types=1); use function Http\Response\send; use Psr\Http\Message\ResponseInterface; class ResponseSender implements ...
0
votes
0answers
53 views

How to debug Icalendar URL in Google Calendar

I'm developing a ICalendar service. If i add the URL in outlook everything looks correct, but if i import the URL in Google calendar it does not show the description of event. As google calendar ...
8
votes
3answers
454 views

Is it possible to programmatically evaluate safety for arbitrary code?

I've been thinking a lot lately about safe code. Thread-safe. Memory-safe. Not-going-to-explode-in-your-face-with-a-segfault safe. But for the sake of clarity in the question, let's use Rust's safety ...
9
votes
4answers
579 views

Refactoring - is it appropriate to simply rewrite code, as long as all tests pass?

I recently watched "All the Little Things" from RailsConf 2014. During this talk, Sandi Metz refactors a function that includes a large nested if-statement: def tick if @name != 'Aged Brie' &&...
0
votes
1answer
67 views

Unit tests involving library functions and objects

I am making a project using the Laravel framework. I plan to create unit tests for my project. But I feel I don't really have an idea what to test because I mostly use library or framework functions. ...
0
votes
4answers
228 views

What exactly caused the recent increase in automated testing?

Recently I've heard a lot about automating test is taking away manual jobs from the QA sector. When I look at example of what it is about most of it is just running a sequence of functions over and ...
22
votes
6answers
1k views

continuous integration for scientific software

I'm no software engineer. I'm a phd student in the field of geoscience. Almost two years ago I started programming a scientific software. I never used continuous integration (CI), mainly because at ...
3
votes
3answers
208 views

Does Defect density measure QA or DEV effectiveness?

Most Defect density metrics are like this: Number of bugs / Size (KLOC, Story Points, Function points..) I have read that it measures the effectiveness of QA but I do not get it: I can have a ...
1
vote
1answer
87 views

Mutation Testing - Exceptions and Infinite Loops

I'm writing a mutation testing system for Clojure and I was wondering what the general consensus is for when a test causes a mutant to throw an exception or enter into an "infinite" loop (my system ...
2
votes
4answers
220 views

Only test when necessary in agile software development: good or bad idea?

When taking an agile development approach, it is obvious to only implement features when necessary. My question is: can the same be applied when it comes to testing, i.e. creating test cases and only ...
-1
votes
1answer
136 views

How to ramp-up software testing from zero on a code base of approximately six years of development and in a team without practical knowledge?

In a feedback for a (deleted) question I asked here last year, I was also told that there is not easy way to do software testing. We may find prepared test cases for protocols but in most case the ...
-3
votes
2answers
151 views

Is there such thing as minimum testing required when building a software?

As far as I know, ideally testing should be done extensively as hard and far as possible, however sometimes (always) we are required to ship quickly. In case of a delayed or a over-deadline projects, ...
5
votes
2answers
437 views

Should I be unit testing during prototyping/preparing for beta?

I am developing a web application for an industry that desperately needs it. Working with a consultant in the industry, I’ve rapidly developed a prototype in 2 months that we will be testing with a ...
1
vote
0answers
59 views

How to test customer journey with mostly the same structure

I often hear that a test should contain only one assertion (Disregarding testing attributes of a class) and where the whole pre-conditions for the test should be setup before the assertion. In our ...
1
vote
0answers
40 views

Unit testing multiple values [duplicate]

If I create a function to calculate the square root of a number, I suppose i should write a single unit test (maybe two, to test how it handles negative numbers). But what if I have a function which ...
1
vote
2answers
80 views

How to setup data for service tests

We are trying to work out the best way to setup test data when we run our isolated functional tests. These tests test just the service and mock out other dependencies and use an in memory database. ...
3
votes
4answers
253 views

Should outgoing messages from object under test be tested?

I was watching a recording of a conference by Sandi Metz on testing. One of the things that I struggled with was that she said not to test outputs of the object under test (her example was query ...
4
votes
2answers
153 views

How could a test engineer aid test-driven-development in continuous integration?

In an environment where you can't merge code that fails tests you obviously can't merge new, failing tests. But how to deal with a newly found bug exploit, meaning you wrote a new test exposing an ...
0
votes
0answers
32 views

Calling other methods in unit test [duplicate]

I was learning about test driven development and came across unit testing. I have few questions regarding testing a class containing several methods; assuming i consider each of these methods a unit ...
1
vote
1answer
84 views

A performant and robust way to reset multiple files to its original state (TDD)

In our automated Java tests, we sometimes encounter issues, such as: Test A creates a custom file A.sh, that is then added on classpath Automated testsuite cleanup does not know about random file A....
6
votes
5answers
545 views

How far should I go with dependency injection and mocking?

Say I have a following class: public class A { public void execute() { if (something) ThirdPartyApi.method(); } } Now, I would like to test in particular the execute() method. I ...
0
votes
2answers
219 views

How can I test generated assembly?

I'm working on a C compiler for Linux for the purpose of personal curiosity/fun. How can I test the generated assembly before the compiler is complete enough to do anything useful? For example, if I ...
-1
votes
1answer
59 views

Check files after git push, or; best practices for github after push tests

Sometimes our developers push -simple to find- mistakes to our repos, like a missing ";" a "console.log" that is not suppose to be in the main branch, or an invalid json file. With Github you can add ...
1
vote
3answers
196 views

Automated test “all changes are feature-flagged”, possible?

Let's say in an effort to improve quality, your team agrees on the following policy: all commits to the master branch (direct or via pull request) have to be categorized as either bugfixes or ...
-3
votes
1answer
90 views

test class that include another class - Only one test or both

i have a sytem a that include system b and return the result. simple!. concrete example an API, one controller that internally call another class then perform the operation. route --> controller ...
0
votes
1answer
83 views

How to Automatically Tell What is Not Tested [duplicate]

I feel like I've heard the phrase "Automated Test Coverage" but not really sure what it means. I am wondering if there is a way to do some sort of program analysis that will tell you which parts of ...
1
vote
0answers
31 views

Integrating Testing with Model Checking

So with Model Checking you have a specification and the model checker automatically goes through your program's states and checks if it matches the specification. What I don't understand is where ...
-1
votes
3answers
170 views

Should one be able to access a db during tests?

I had a conversation with a colleague about tests. They want to be able to access a db that is only accessed by tests. The db is created in memory and deleted after tests are done. My colleague wants ...
67
votes
16answers
15k views

How to avoid logical mistakes in code, when TDD didn't help?

I was recently writing a small piece of code which would indicate in a human-friendly way how old an event is. For instance, it could indicate that the event happened “Three weeks ago” or “A month ago”...
7
votes
4answers
562 views

What's the practical development cycle of a large project when a full build is prohibitively long

Projects like webkit, Linux kernel and many others take over ten minutes if not hours for a full build. What's the practical development cycle for these large projects? Specifically, how does a ...
0
votes
1answer
167 views

How to load test Publisher/Subscribing queue?

I am trying to load test a queue that works on a pub sub pattern and can't figure out how response time is to be calculate and the TPS(transactions per second). Problem statement : The pub sub ...
4
votes
5answers
682 views

If 100% test coverage is possible

In thinking about formal verification techniques, you also need to have test coverage. But as that article shows, you can easily say you have "100% test coverage", but every test doesn't have any ...