With so many testing frameworks to choose from, and taking into consideration that continuous integration with Jenkins is a must, which would currently be the best/least-complex stack for unit testing a Backbone app?
Related
I am an experienced c++ developer, but I have not spend much work in design of applications. Question:
I am working on an existing application that consists of the following layers
HTML5 front-end
Database that communicates with the front-end via stored procedures
Back-end c++ application running on Linux servers that communicate with the database via a job-daemon
We want to introduce more automatic testing into the application. We want full end-to-end tests, as well as individual tests on each level, i.e. test of front-end, test of SQL stored procedures, and test of back-end.
Is there some kind of unifying framework where I can setup tests across all layers? And e.g. a board that provides overview of test results.
Thanks in advance!
Given a DDD application with a hexagonal architecture, which layer should my JBehave acceptance tests target?
I want to write Features and scenarios as specifications for the overall system behavior as we are introducing ATDD as our development process.
In my application I have these layers:
Presentation layer
Web services layer
Application services layer
Domain layer
Infrastructure layer
Generally JBehave is seen as unit testing framework for Behavior-driven development, which I think will combine well with your current design
we are introducing ATDD as our development process
So as bottom line - it's strongly recommended to have unit tests for all app levels, but I think that especially in the case of JBehave, it will be helpful if you use it not only in your Presentation, but also in Application services and Domain layers too.
I am working on a project which has 3 tier architecture:-
1. Business layer 2. Data layer 3. Service Layer
I want to unit test my Service layer.
Currently I succeeded to add a unit test to my Business layer by faking the Data Layer.
Now the issue is, I have a service layer which makes call to my Business layer, which in turn makes calls to my Data layer.
Initial test case that passed was written by adding a reference of Business layer project in my Unit test project and then creating Fakes of the Data layer.
Now what I want to do is, I want to achieve this by adding Reference of Service in the Unit test project and also using Microsoft Fakes at the same time.
Can someone please help me in understanding this? I am new to this Fakes framework.
This question is old, but hopefully it helps you, or someone in a search:
You seem (imho)to be mixing what is needed in your architecture(and/or integration testing) vs what is needed in unit testing. If you are trying to fake for unit testing, remember SUT! System Under Test should be the only component you are testing. In which case, if you are testing a component in your service layer you should fake(shim or stub) any calls external.
http://msdn.microsoft.com/en-us/library/hh549175.aspx
Gives a good example with the IStockfeed stub.
Please clarify if you are trying to integration test or unit test.
We have had some success using selenium and web driver along with Jbehave. just wanted to know what others are using for unit testing the web tier of any web application?
the reason i am asking is , writing web driver test cases along with jbehave makes the unit testing very complicated and in more cases, it is taking more time then writing an actual JSP page.
A few ideas for unit testing a web tier:
Use MVC for doing web development. It is pretty easy to unit test controllers assuming you extract all your dependencies.
Make liberal use of interfaces to extract dependencies in your JSP pages. For example, does your JSP make a database call? Consider making an Repository interface and then have implementations like MySQLRepositoryImpl.java that implement the interface. This way, you can also "mock" the interface and create a fake database that will run fast in your unit tests.
For very difficult problems where you absolutely need to use a dependency, you can get embedded versions of things like web servers (Grizzly, Jetty) or even databases (H2, SQLite).
Make sure you write your code such that each function does one thing and one thing only. This will take some refactoring, but it makes testing so much easier.
Does anyone have any opinions on how TDD and UNIT testing would would when developing web services using Oracle Service Bus? All I can think of is stubbing out the back ends then running tests through the service bus, but that's really just integration testing. How would I apply TDD principles in this instance?
Is your question actually how best to conduct unit tests on Oracle Service Bus components? I have the same issue but have come to the view that now your unit of code is not a Java method or a class but a whole proxy.
It does however limit you to being only able, at best, to conduct component integration testing as you have described: Stubbing out the other systems and running what you'd traditionally call Integration tests through the Service Bus.
Scale up your unit of work.
If there is a better way to automate and test these code artifacts then I want to hear about it.