- Software Testing is the most important step of the development cycle and is considered essential knowledge for any software position, but is often overlooked when preparing for interviews.
- Testing questions are always fair game as a quick interview trivia question, so here’s a quick cheat-sheet of the most popular terms for you to be prepared the next time you’re asked about testing.
> Main Difference: The visibility of the internal design
- The tester knows how the code works and what it does
- Lower level (more rigorous) testing
- Time consuming
- Testing your own code after your write it (unit testing)
- Testing every if-else case in your code (path testing)
- The tester does not know how the code works but may know what it does
- Higher level (less rigorous) testing
- Time efficient
- Testing function outputs to a series of inputs
- General usability (speed, security, reliability, non-functional testing)
- The tester knows how the code works through its design specification and documentation such as UML and database diagrams
- Preserves the boundary between testers and developers
- Compared to White Box testing, the tester does not have access to the source code
- Compared to Black Box testing, the tester has more information about the item itself
- Testing an API using its documentation
- Ensuring software meets its design requirements
> Does the code run as expected without any bugs?
Quick Summary: A test written by developers to ensure that a “unit” of code (usually a module or a function) behaves as intended
- Detect bugs early (don’t ship your code if it’s already broken!)
- Isolate a unit to its own independent environment to reveal and remove extra dependencies
- Can be performed both manually/automatically with a test framework
- White/Black/Grey box unit testing
- Using basic assertions to ensure that the program state is behaving as expected
- Using a test framework such as JUnit to write code to simulate automated test inputs for a function
- Be informed of the testing frameworks available to the language you will be working in to score some extra points with the interviewer
- Combine units and test them together
- Usually performed after unit testing
- Focus on interactions between components
- Focus on interactions between systems of components
- Ensuring that nested React components in a website behave correctly (component integration testing)
- Interacting with an API using your program without errors (system integration testing)
- Retesting code requires prioritization of test cases
- Testing is expensive! Choose the most important tests to maximize test coverage and efficiency
- Best if automated using an automated testing tool such as Selenium
- Update the test cases frequently for new code changes
- Retesting after writing new code
- Pulling new code from the development branch
- The most important functions should be working
- If the device does not catch fire and start smoking, proceed with further testing
- Usually black box testing (quick and efficient)
- The first test before running other, more intensive tests on new code (Integration, Regression, System)
- Usually performed after Integration Testing and evaluates the end software product
- The most important step of testing, many different types of functional and non-functional tests are performed at this stage
- Guarantee that all the components work together and the system functions as expected
- Smoke Testing
- Regression Testing
- Usability Testing
- Performance Testing
- Security Testing
> Improving the code’s performance and usability
- Conducted at the end of the software lifecycle for sequential models such as Waterfall
- Conducted at the end of each iteration for iterative models such as Agile
- Black Box Testing
- Alpha testing an unreleased game within the company (Internal Acceptance Testing)
- Beta testing an unreleased game by sending copies to popular streamers (External Acceptance Testing)
- Find frequent use cases and make them more efficient
- Condense long processes into simple steps
- Detect user misunderstandings and operation errors
- Black Box Testing
- Observing a user complete a set of tasks, noting their thoughts as they use the software
- Find the system bottlenecks to optimize them
- Monitor system performance and endurance under different workloads
- The system should perform as expected under heavy loads
- Flooding an e-commerce website with online orders until it crashes (Stress Testing)
- Pushing the system beyond its limits
- Having many users visit and browse your website frequently (Endurance Testing)
- Continuous workload
- Handling a massive influx of online shoppers during a sneaker drop (Spike Testing)
- The workload is abruptly increased
- Build user trust with robust security
- Analyze network, system, client-side, and server-side security
- Examining network policies and external data transfers (Network Security)
- Assess the software that the program depends on (System Security)
- Ensuring that local manipulation in the client or browser cannot occur (Client-Side Security)
- Confirming that the technology used on the back-end server can withstand intrusion (Server-Side Security)
- An iterative software development lifecycle
- Very flexible, client-oriented process
- Performs testing very frequently after every iteration of the product
- Continuous feedback to improve software
- Tests planned on whim and test processes are less structured
- Test cases are continually changing to meet changing demands
- Has a focus on software that works
Some sample interview questions with examples answers. Many of these questions are open and have many answers; try to come up with your own!
Some popular ones include:
- pytest
- unittest
- JUnit
- TestNG
- MochaJS
- Jest
- Jasmine
- Selenium
- Cucumber
- Capybara
> I designed and wrote scripts to automate testing for an e-commerce web application using the Selenium WebDriver library in Java
- Unit Testing
- Integration Testing
- System Testing
- Acceptance Testing
- Regression Testing can be performed in-between any of these levels
- Be clear and concise. Write not for yourself, but for the person after you.
- We want to minimize our test cases while maximizing the chance to find a defect
- The test case should always generate the same results, no matter the environment
- Software Testing is validating whether software meets the consumer’s needs through the design of test cases
- This cheat sheet focuses on Software Testing and its applications
- Software Verification is more rigorous; formally proving using a proof system whether software is “correct” to its specification
- Not all software can be formally verified
What kind of testing would you perform on a retractable ballpoint pen during the design process to verify its quality?
Try to be specific and creative! Think about how all the individual components interact with each other.
- Does the ink tube leak?
- Is the pen’s body durable?
- Does the ink tube retract properly?
- Can the pen write?
- Do all the pen parts fit inside the body?
- Does the retraction mechanism interfere with the writing mechanism?
- A new click-spring mechanism is introduced to the pen, does this affect pen retraction?
- After assembling the pen, does the pen leak?
- Is the pen comfortable?
- Does the pen write smoothly?
- Can users easily figure out how to retract the pen?
- Will users recognize that it is, in fact a pen?
- None. Testers do not fix problems - they just find them.