What is the difference between PhpUnit and PhpRack? - testing

I know they both are for testing but I did not find much information about PhpRack here. Can we use them together in a project? Or only one can serve the purpose?

PHPUnit is a unit testing framework. Unit testing considers the testing of software from the perspective of discreet units of code, such as a class or method.
PHPRack is an integration testing framework. Integration testing considers the testing of how separate software modules/systems integrate together in a production environment.
Unit testing and integration testing are not the same thing. A development environment can use both.

Related

Should the QA team be doing unit test?

I come from a configuration management background using tools like chef. I have done quite a bit of code testing. Recently, I have been entrusted with the responsibility to work on the CI-CD of the various applications. But I am noticing a culture that’s quite not in line with my ideology.
Let’s say we have 4 environments in the CI-CD pipeline: Dev, Test, Stage & Prod. The dev environment is used by the developers to deploy and test the app before rolling out to the next stage (test). The test env is for the QA team to run their test. And STAGE is another env for 2nd layer of test by the QA folks before the code goes to prod.
Now, does it make sense for the QA or the CI process to run unit test while progressing/after deploying the code to (TEST or STAGE)? I agree that the unit test should be a part of the automated build. But unit test is mainly for the developers, for their code testing. The QA should be focus on the functional testing, load testing etc.. using their frameworks which may be selenium/protractor or LISA. Why should they be focusing on junit or nunits?
From my experience the developers do the unit testing.
Where I currently work, we follow TDD (Test Driven Development) so developers write the unit tests for their code first and then they write the actual implementation. This work goes on the Dev environment.
The QA people then do the acceptance tests and review stuff.
I hope this helps.
Unit tests are short code fragments created by programmers or occasionally by white box testers during the development process. Unit tests are typically written and run by software developers to ensure that code meets its design and behaves as intended.
Hope you got the answer.
Your concern is absolutely right. QA does not necessarily be doing Unit Testing (If that's what you mean). This testing is done by dev while they were writing the code (if they were in TDD environment or even if in BDD).
However if QA has used Junit to write their Selenium automated test cases then they will be using Junit to update and change their automated test cases.
It's little difficult to automate Selenium test cases using Junit whereas using other framework like TestNG is the best option to write automation test cases for Selenium.
I hope this answer your question.

Integration testing, how exactly

I have a hard time figuring out how you actually do integration tests
Is it still automated test with JUnit, NUnit or whatever, or is it just using the program (it has a gui) an making sure that everything works?
You can refer what-kinds-of-tests-are-there and whats-the-difference-between-unit-functional-acceptance-and-integration-test
GUI testing can be listed in system testing, acceptance testing.
GUI test tool mostly depends on type of UI (Web/Desktop/Mobile). e.g. for web testing you can evaluate good open source tools like selenium.

Can NUNIT, a unit-testing framework, be used for integration testing?

Can NUNIT, a unit-testing framework, be used for integration testing? It seems to be working that way for me now. Are there other automated testing frameworks out for integration testing?
Yes, you can use NUnit for integration testing. For that, you may take an advantage of attributes like [Setup] and [TearDown].
Other .NET unit test frameworks which can be used for integration testing as well are:
MSTest
xUnit.NET
For more testing framework types (UI testing, database testing, web testing, acceptance testing, etc.), you may check List of Automated Testing (TDD/BDD/ATDD/SBE) Tools and Frameworks for .NET.

Organization and Structure of Web Application Testing Framework

So I'm looking to bring web application testing into our .Net environment with a framework such as Selenium. At first, it'll probably be the developers writing the tests, but later it may be just the QA team. I'm wondering where the tests should actually live. Should they live in the same solution that the web application lives or should they live in a completely separate solution that is just for the tests? Please, note these are regression tests that will be done via automating a web browser so access to the web app's assemblies is not required. The answer probably is based on the environment and other factors, but I'm curious about what other people have done in this situation.
Regression Testing covers both Unit and Functional Tests. Functional tests exercise the complete program with various inputs. Unit tests exercise individual functions, subroutines, or object methods.
Unit Tests are part of the solution's code and should live with the Primary Code as with Microsoft MVC. Since Functional Tests examine the whole system and not just components, they can live anywhere. However, since your Functional Test are automated scripts, they should be included inside the solution.
The advantage to having both Functional and Unit tests live with the code is the issue of project management. Having all project related files in one repository links code version with test version. Testing scripts need to be stored in a repository (version control system) just like any other project code, so it is good to keep them with the solution.
That way the test team can do white box testing (testing with access to code) by checking-out the solution just like a developer. Their work can be saved, shared, and documented inside Visual Studio. Microsoft even includes some web based management tools with Team Foundation Server that can be used for managing the testing with open communication between test team and developers.

Any experience with groovy as core testing language?

I think I am not the only one who is gonna ask this question next time.
After some experience with RoR I am impressed with the power of dynamic languages. Lots of projects are still forced for different reasons to use a java technology stack though. Since testing is an important part of any project I would like to hear your experience about building an enterprise project with groovy as main testing language and NOT in production code. It think this is a perfect scenario to start with this language.
How was your experience for this constellation, specially regarding following points:
Integration in Eclipse: calling java apis, still with auto complete functions possible?
Stability any Performance of groovy, if you have a typical java stack (Spring, OR-Mapper)
Integration of the groovy tests in the ant build and continuous integration server
Adaptability by a java team of 4 developers
Thanks a lot!
Denis.
Integration in Eclipse: minimal, but effort is underway by SpringSource, with expected good results in a couple of months;
Groovy is stable in my opinion, but the performance is not stellar. But then again unit testing does not need to be ultra-fast, just fast;
Integration: it's done for both maven and ant;
Integration into Eclipse is functional. It is not the best but it is continually improving. It is certainly good enough for unit tests.
Stability is fine. Built on the JVM I have not had any stability issues with Groovy. As for performance it is a bit slower than pure Java but you can mix Java code in if that is a huge problem. Honestly, I don't think performance should be a concern for a testing language. Groovy performance is good enough for most applications.
Integration into unit tests is pretty easy. Groovy compiles to Java classes. As long as your groovy libraries are on the classpath, JUnit can execute your groovy tests. I use groovy for automated tests mixed in with some older Java only unit tests. We run it nightly in CruiseControl in a Maven project.
Groovy is pretty easy to learn. It is similar enough to Java that your 4 developers who probably know Java should have no trouble picking it up.