Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 2 years ago.
Improve this question
Our company is trying to adopt UI test automation. They showed me their previous attempt on Test Automation which was basically what you can expect from over worked QA engineers who are asked to create a test automation project alongside their other duties in short frame of time. From what i saw it had many flaws and wasn't successful. I am beginner in this field and i would like to find out about,
Any detailed guide of best practices in UI Test Automation
Any github repo for test automation project done by some
respectable company in software development showcasing best practices.
The reason i am posting here is that most of the guides i found online was basic or lacking details. Also it's impossible to find test automation project done by some software company. If any of you guys work in a company which has public repo kindly share it here that would be mighty helpful.
You probably aren't finding stuff online because typically those framework materials represent time and investment. They're either sell-able material (e.g. consultancies that have generic frameworks) or bespoke for a client (which e.g. expose internal system workings).
An automation framework starts with some requirements gathering. Loads of things to consider - Some sample thoughts:
Do you know what you want to test?
Is it purely web? Is it thick client? does it involve mobile? a mix and match?
Are you involved with the dev team? do you know what's been tested at the different levels before you get to the UI?
Do you have the right skills to follow this through?
If you google "automation framework requirements" you'll get a lot of ideas.
This article [disclaimer! - i wrote it] talks about automation problems you encounter from the top level without into the code. I'd consider most of those pretty good practice and there are parts of it you can plan for early on.
Taking a bit from the article:
Automation needs to test the right things
Automation needs to just run
Automation needs to run well
It uses examples from my career of things I've seen done wrong and how to correct them.
Beyond that....
Modern automation typically steers you towards the test automation pyramid (not my article this time).
When you get to the lower level, general programming rules are important. I can't give you a direct steer on a framework you've not designed but simple rules help:
DRY
YAGNI
SOLID (as much as you can)
Final thought here is you don't have to build a framework.There are generic open source frameworks out there which can get you started.
Make sure that application is in Regression stage
Automating and stabilizing tests take a lot of time
Don't try to automate everything in the beginning. Automate the most important tests. Flows which are followed by most of the people on the Website.
Decide the framework - data-driven or hybrid or POM
The decision of which framework to use saves a lot of time in the future. Data-driven is most simple and easy to change as well. POM and hybrid are complex but can be more reusable.
Look and understand some existing automation frameworks before you choose a new one.
Decide on the type of reporting you to need
Using Selenium for automated testing is a learning curve. It’s not as simple as copying from a working example. This is an article on Selenium automation testing to help you get started with learning the best practices. When beginning your journey with Selenium, identify a small UI feature to automate so you can familiarise yourself with the setup of required components, and how to run and manage the test. Try start with testing something like a login process, after which you can create more tests that incorporate more UI functionality once you fully understand the whole Selenium/Java environment.
Related
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 3 years ago.
Improve this question
How far a manual tester can upgrade himself to learn automation testing(java, selenium webdriver, testng).
which programming will be easy for stepping into scripting for beginners
You can upgrade yourself as much as you desire. There might be limitations on how quickly you can do it - due to your ability to find out time, level of interest and how things are at work.
In my experience, like any other language (french, german, hindi, etc.), each programming language has its semantics and syntax. The more time one spends practicing them (writing small programs, not reading from a book) the quicker one learns the language.
Being widely used and around for a long time, the support and learning avenues available for Java are much more so the process of getting help might be easier.
Java is also very helpful if you are trying to pick up selenium webdriver.
The task and scope of learning a scripting language becomes very specific when trying to learn it for automation testing. Usually, you will be able to get through solving fairly complex issues if you master the following concepts in Java:
OOP’s concept – Class, Objects Polymorphism, Inheritance and Encapsulation
Java Programming essentials- Object Instances, method overloading/overriding concepts and packages
Control Statements – While, do-While, Switch, If statements.
Looping statements - Helpful in scenarios like, iterating through a large table to find a record that you want and running the same test for multiple number of times
Arrays Concepts.
Java Collections Framework – ArrayLists and HashMaps – This will help us in maintaining a collection of data. Particularly useful for scenarios where you need to compare the data from Web app UI with the DB. [OR] From UI to another UI
File Streams – Used for externalization of data through CSV, Excel or Java Properties file.
Threads and MultiThreading Concepts – This will be helpful when trying to run scripts in different threads that will help in achieving better performance.
Easy Answer: Keep going to Stack Overflow. Read as much as you can, then go try it.
If you want a start, these are good to read up on:
Test format: TestNG
Text Editor: Visual Studio Code
Ruby Application Testing:
RSpec, Capybara, Selenium, Cucumber, Nightwatch, etc... etc...
React Application Testing: Jest
Java Application Testing: Apache Maven (Makes setting up the project easy), Java, Selenium
CI/CD: Jenkins
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions asking us to recommend or find a tool, library or favorite off-site resource are off-topic for Stack Overflow as they tend to attract opinionated answers and spam. Instead, describe the problem and what has been done so far to solve it.
Closed 8 years ago.
Improve this question
I am trying to implement a cluster computing system using Java and the Windows OS. I'm looking for a solution that
is not too out of date
is reasonably easy to install and set up
has enough documentation to get started with the classes and methods without a previous knowledge of MPI
is at least somewhat user friendly
This might not be possible, but it would also be nice if it was somewhat close in usage to the Java Concurrent framework.
I initially learned a bit about the Java Concurrent package and was easily able to learn to write parallel programs on my local 8-core machine using the Runnable Interface and the ExecutorService, making all my classes threadsafe in the process. However, I have yet to find a standard mechanism to extend this programming framework to clusters.
I then learned of a GitHub project called Java-Interop-Library (https://github.com/MicrosoftHPC/Java-Interop-Library ) that could be used with Microsoft HPC Pack. I networked a few cloud computer via Amazon EC2 and installed the HPC Pack. The Java-Interop-Library was a nightmare to compile and set up. I had to manually edit several batch files and even some Java code to get it compiled. By the time I got most of it working (but not everything), I just started thinking that there had to be an easier way, and I started searching again.
My new search led me to MPJ-Express (http://mpj-express.org). I read through the documentation on the site, and it seems easy to set up. They even have documentation on how to integrate it with Eclipse and debug. But, I could never find any documentation on how the classes and methods are actually used (there's a simple hello world example, but it's not close to enough).
More searching led me to MPIJava, Hadoop, and GridGain. Having no experience with MPI or MPJ, and knowing that MPJ grew out of MPIJava, I started trying to find documentation for that instead. I found some docs, but some of it is quite old and I'm not really sure I'm on the right track. I saw the mention of GridGain on another StackOverflow post, and went to their website. They seem to have a cluster computing framework, and a simple posted example even uses what appear to be classes that use Runnable objects, which seemed attractive to me having had some experience with the Java Concurrent framework. I don't really know anything about Hadoop, other than that it might be a possibility.
I really just need some better direction on the best way to accomplish cluster computing i Java. I feel like I'm just spinning my wheels.
You can use MPJ Express and I assume that you have already given it a go and environment set up is done. MPJ Express can execute parallel Java applications on both multiocore mode and cluster mode. It must be mentioned there that the same application works for both modes without any modification so you have the option of developing and testing your application in multicore mode and when done it would seamly run cluster mode as well. Although It is not quite clear what you want to develop in the end but as far as its Java docs are concerned you can find them here: http://mpj-express.org/docs/javadocs/index.html. These are all the classes and methods that you need to develop any parallel java application.
Learning cluster Programming with MPJ Express is quite easy as you can access a comprehensive set of working examples. For this purpose unzip MPJ Express and explore test directory. It contains multiple test cases and working examples of parallel Java applications. You can have examples of point-to-point and collective communication in mpj-v0_xx/test/mpi/pt2pt and mpj-v0_xx/test/mpi/ccl respectively. You can develop any basic parallel application by just using point-to-point and collective communication methods. It would give you head start in learning cluster Programming using Java.
Let me know if you encounter any problem in setting up MPJ Express on cluster or executing examples provided in test directory. You can also post your queries on MPJ Express mailing list on following page: http://sourceforge.net/p/mpjexpress/mailman/?source=navbar
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 8 years ago.
Improve this question
We're developing a data heavy modular web application stack with java but have little expert knowledge concerning tests. What we currently do is using JUnit to run a mixture of unit tests and functional tests. I described the problem in more detail here.
Now we decided to set up standards early on, on how to test our modules and applications so we'll need to read up on the principles and best practices of testing in general and in the java spring environment in particular.
What I'd like to have covered are the definitions, use cases and reasoning behind the different kinds of tests from unit test to scenario test, or as google calls them: small, medium, large tests. Like I said, we're developing a data heavy web application.
I'd like to be able to deduce from the book how necessary and how useful each testing stage is on which corresponding level of our application (core, database access, security module, entity managers, web-model, web-controller, web-view)
It would be nice if the examples in the book are directly applicable to our application stack. We're using spring, JPA(hibernate), JSF, spring security. For testing so far we're using the basic Junit and some powermock. So JBOSS, Seam or Java Enterprise books are not so usefull.
If there are great articles on the web that paint a clear picture and really do help, feel free to share those as well (I can use google, SO and wiki myself, so please only articles that you actually read and deem very helpful), but a book would be nice so I can read up from the basics and don't have to piece it all together from various articles and questions.
Thanks!
Edit - books we ordered
Just started reading Growing object oriented software guided by tests and I already like it a lot. Not for the total beginner but shows how to develop test driven with agile techniques. Really cleans up old ways of thinking about software development.
We also ordered xUnit Test Patterns: Refactoring Test Code to get an idea of how to best unit test the different areas in our application stack. Got this recomendation twice so I'm hopeful it will be helpful.
Take a look at the resources under this answer. I highly recommend the first three books, the first two directly address your "levels" questions. The first is more focused on specific tools, while the second is more conceptual.
Book recommendation: JUnit Recipes - Practical Methods for Programmer Testing
Tools: JUnit + Hamcrest + Mockito
And you're using Spring, check out spring-test, it offers some great facilites, Spring Testing
Hate to give you a snippet of an answer (as you've said you want a solid guide) but I can't really recomment any books. Best practices should involve TDD though. It's much bandied about but it aids regression and eases the mind when those ad-hoc quick requirement changes come in (when you know you've a solid codebase).
Additionally, you may want to see if BDD (Bean Driven Development) is right for you. I mention this as you may not stumble upon it in your searching. Advantages include translation from English to test cases to prove test scenarios in terms of goals. This allows you, your testers and even your product owner to easily correlate the tests with your requirements:
See easyB
SpringBeans in easyB
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 7 years ago.
Improve this question
We are developing an application that involves a lot of different tests where each test lead the users to a number of steps. We are thinking of using a state machine framework to capture the states/transitions out of the code. We are also thinking of using rule engine to supplement on the rules. Anyone has experience with any state machine framework that would work with JBoss and/or Java? Thanks in advance.
-nguyen
jbpm does this and integrates well with jboss. In my experience, it's pretty easy to use and is powerful.
You might want to look at StatefulJ. It is built off of Spring Data for Persistence support and the State Model itself is defined using Annotations. This approach makes it easier to set up and maintain vs. XML. Regarding rules - I've used Drools in the past and seems very well supported.
Disclaimer: I am the author of StatefulJ
if you are building some screen to screen transition - based system, then you should definately check out Spring WebFlow http://springframework.org/webflow
I have had very good experiences with using ragel to build easily maintainable state machines. The resulting java code is of very high quality. However, it is purely a state machine generator with no specific usage intended, so you might find other solutions that will more seamlessly work in a web related problem domain.
Maybe you can take a look at JBoss PVM. It is still in alpha, but can be used to model any type of state machine. We are also looking into it for gui transitions.
http://www.jboss.org/jbossjbpm/pvm
Try Activiti, seems a lot of people are using it.
http://activiti.org
For the rules engine part you could use Drools, of course.
Have a look at StateBuilderJava, a state machine code generator that transforms an XML description of a state machine into an extended version of the Java state pattern. It supports all UML semantics: state machine can be hierarchical, concurrent and asynchronous.
Each test scenario can be modelled with a state machine Xml description, the code generator writes the state pattern of your behalf, which is tedious and error prone if done by hand.
The other advantage is to visualize and edit the test scenario with a graphical tool.
This allows to quickly implement and document a set of test scenarios.
In the examples, a test suite of an XMPP client has be written to illustrate how state machine code generators can be used to write complex test scenarios easily and quickly.
Disclaimer: I'm the author of these software.
I've used activiti.
It is the best framework.
It is a light-weight workflow and Business Process Management (BPM) Platform.
Open Source and works on any Java Platform or cloud.
All one needs to have is the knowledge of BPMN , Maven , Spring and Activiti.
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 2 years ago.
Improve this question
What is the best, preferably free/open source tool for auto-generating Java unit-tests? I know, the unit-tests cannot really serve the same purpose as normal TDD Unit-Tests which document and drive the design of the system. However auto-generated unit-tests can be useful if you have a huge legacy codebase and want to know whether the changes you are required to make will have unwanted, obscure side-effects.
Not free. Not opensource. But I have found AgitarOne Agitator (http://www.agitar.com/solutions/products/agitarone.html) to be REALLY good for automatically generating unit tests AND looking for unwanted obscure side effects
It is interesting, but such generated unit tests can actually be useful. If you're working on a legacy application, it will be often hard to write correct, state-of-the-art unit tests.
Such generated tests (if you have a way of generating them of course) can then make sure that behavior of code stays intact during your changes, which then can help you refactor the code and write better tests.
Now about generating itself. I don't know about any magic tool, but you may want to search for JUnit functionality about including some tests in javadocs for methods. This would allow you to write some simple tests. And yes, it's actually of some value.
Second, you can just write "big" tests by hand. Of course, these wouldn't be unit tests per se (no isolation, potential side-effects, etc), but could be good first step. Especially if you have little time and a legacy application.
Bonus Tip! There is an excellent book "Working effectively with legacy code" with examples in Java, including techniques right to use in such situations. Unfortunately you would have to do some things manually, but you would have to do that at some step anyway.
To be honest, I probably wouldn't do this. Unit tests are isolated and you won't actually know if you have "unwanted, obscure side-effects" because everything is walled off from the other things that cause the side effects. As a result, you need integration or system testing and that is not something you can automate.
Build a few high-level, end-to-end system tests which give you a degree of confidence and then use coverage testing to find out what you've missed, The downside is that when bugs crop up, it will be harder to point to their exact cause, but the upside is that you'll be far more likely to see the bugs.
Once you find bugs, write unit tests just for them. As you move forward, you can use TDD for the bits you want to refactor.
I know this probably wasn't the answer you want to hear, but I've been testing for many, many years and this is a solid approach (though I would hardly call it the only approach :)
Coview plugin for Eclipse (http://www.codign.com/products.html) looks just the job. I'm interested in generating tests that cover all the paths in the code, and this seems to do it. It also generates the mocks which should save me tons of time.
Diffblue Cover is a product that does this, and there is a free Community Edition that's an IntelliJ plugin, here: https://www.diffblue.com/community-edition/download/
It works by using reinforcement learning to search the space of potentially useful tests, and strives to write human-like tests. It automatically creates mocks and has full Spring/SpringBoot support.
Here's an example test for the owner controller in Spring PetClinic that it wrote:
#Test
public void testInitUpdateOwnerForm() throws Exception {
// Arrange
Owner owner = new Owner();
owner.setLastName("Doe");
owner.setId(1);
owner.setCity("Oxford");
owner.setPetsInternal(new HashSet<Pet>());
owner.setAddress("42 Main St");
owner.setFirstName("Jane");
owner.setTelephone("4105551212");
when(this.ownerRepository.findById((Integer) any())).thenReturn(owner);
MockHttpServletRequestBuilder requestBuilder = MockMvcRequestBuilders.get("/owners/{ownerId}/edit", 123456789);
// Act and Assert
MockMvcBuilders.standaloneSetup(this.ownerController)
.build()
.perform(requestBuilder)
.andExpect(MockMvcResultMatchers.status().isOk())
.andExpect(MockMvcResultMatchers.model().size(1))
.andExpect(MockMvcResultMatchers.model().attributeExists("owner"))
.andExpect(MockMvcResultMatchers.view().name("owners/createOrUpdateOwnerForm"))
.andExpect(MockMvcResultMatchers.forwardedUrl("owners/createOrUpdateOwnerForm"));
}