JUnit & Unix Flashcards

1
Q

What is Junit?

A

JUnit is a unit testing framework used for regression testing.
The more common IDEs will already have JUnit testing integration installed by default.
It is a foundation for launching testing frameworks on the JVM.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What is TDD?

A

TDD means Test Driven Development. The process of writing your test to fail first to establish the functionality of your application, then right the code to pass the test. The approach goes: write empty methods, write tests, implement code in the methods to pass the test.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What are annotations in JUnit? What’s the order of execution?

A

JUnit Annotations is a special form of syntactic meta-data that can be added to Java source code for better code readability and structure.
@Before class, @Before, @Test, @After, @AfterClass

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

Give an example of a test case

A
public class TestPassword {
	@Test
	public void TestPassword{
	PasswordValidator pv = new PasswordValidator();
	Assert.assertEquals(true, pv.isValid(“Abc123”));
	}
	}
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

How would you prevent a test from being run without commenting it out?

A

By using the @Ignore annotation

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

How would you test that a specific exception is thrown?

A

By using the ExpectedException class

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

Where are the root and home directories located? How do you get to each?

A

The root directory is the topmost level of the system drive.The home directory is a subdirectory of the root directory.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

What Linux command would you use to navigate to your file hierarchy on the command line?

A

CD

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

What Linux command would you use to list files? How about hidden files?

A

ls, ls -a

How well did you know this?
1
Not at all
2
3
4
5
Perfectly