Intro to GUnit Testing I
Intro to GUnit Testing II
GUnit Testing Best Practices
Intro to Profiling
Capturing a Web Profile
100

Gosu Unit Testing (GUnit Testing) allows you to test (some, none, or all may be correct):

1. User Interface behavior

2. Gosu Code generally, with few exceptions

3. Gosu Rules

4. Gosu Configuration

The answer is 2.  Gosu Rules cannot be tested with GUnit, and neither can UI behavior.  "Gosu Configuration" isn't even a thing.

100

True or false: Gosu tests can be automated as part of continuous integration, but only with the Ultimate license from Guidewire.

False.  No such license is needed.

100

What must all tests include at least one of in order for them to be considered valid as tests?

One kind of assertXXX() statement.

100

Access to profiling functionality is found where?

The Profiler page, or via Alt-Shift-P

100

True or False: Web profiler sessions are saved in the database for examination later.

False.  Once the profiler session ends, the profiled information goes with it.  However you can download the profiled data and examine it with a profile viewer.  These files end with .gwprof.

200

True or False: GUnit class names should start with "Test".

False.  They should end with "Test".

200

assertEquals() takes what three arguments in what order?

1. expected value, actual value, test condition

2. test condition, actual value, expected value

3. actual value, expected value, test condition

4. test condition, expected value, actual value

Choice 4 is correct.

200

Three statements are true about tests:

1. All tests must have header comments describing the test.

2. The test name clearly states the requirement.

3. Test is focused on a specific requirement and asserts correctly within the context of the test name.

4. The test is in the correct place of order relative to the other tests.

5. Tests serve as documentation of production code.

6. Each test is annotated with @Test.

2, 3, and 5 are correct.

1: No such req't.

4: Tests are run in no guaranteed order but in any case good tests should be independent of order except only in rare cases.

6: Gosu tests do not require @Test because the test method name must start with 'test', which flags the Gosu test runner that the particular method is a test.

200

The Entry-Point Profiler profiles what (choose three)?

1. The start page of the GW app

2. User interface responsiveness

3. Work queues

4. Embedded Gosu Server Pages

5. Web services

6. Startable plug-ins

7. ListView query performance


3, 5, and 6.

The entire list is: Batch processes, Work queues, Message destinations, Web services, Startable plugins, Edge API

200

What does GW recommend you use to examine saved profile files?

1. The built-in Guidewire web profile analyzer.

2. Microsoft Excel, using the General Profile Analyzer Add-In available for free from Microsoft.

3. The IntelliJ plug-in designed to analyze .gwprof files.

4. The XMLSpy application.

Answer 3 is correct.

300

Gosu test classes must extend or implement:

1. implement gw.test.Testable

2. extend gw.test.TestingClass

3. extend gw.testharness.TestBase

4. implement gw.testharness.TestCase

5. extend gw.test.TestCase

Choice 3 is correct.

300

What annotation can be used to set up sample data before a GUnit test is executed?

1. @UseSampleData

2. @DummyDataInUse

3. @ImportSampleData

4. @Examples

Item 3 is correct

300

Attributes of well-designed tests are (choose 5):

1. Verbose

2. Readable

3. Maintainable

4. Based on good tests

5. Accurate

6. Reliable

7. Fast

8. Documented

9. Independent

2, 3, 5, 7, and 9 are correct.

300

What must you do to make sure you see stack trace information in the web profiler results?

Check "Enable Stack Traces" in the web profiler prior to enabling profiling.

300

True or False: Clearing the Global Cache is a best practice before starting a web profile.

True.  Use Alt-Shift-T to get to the Server Tools page and choose Cache Info > Cache summary > Clear Global Cache.

400

What if anything is wrong with the following GUnit test method signature?

function someTest() 

1. It lacks the @Test annotation

2. It needs to return a boolean representing success or failure

3. It does not start with 'test'

4. It does not include a required Object parameter

Choice 3 is correct.  @Test is not used in GUnit testing; class reflection identifies the tests to run because they start with 'test' in the name.

400

True or false: Testing web services does not require anything special.

False.  The annotation @SOAPLocalTest is needed to make web service tests work.

400

No Question.  Feel free to come up with one.

None

400

The web profiler does NOT (some, none, or all may be correct):

1. Measure query execution time.

2. Measure browser wait or "hang" time.

3. Measure time unaccounted for by particular processes or events.

4. Measure network latency.

5. Measure process details in externally-invoked processes.

6. Measure code execution timing for sections of code.

2, 4, and 5 are correct.

400

To profile a section of code, among other steps, you must (choose one):

1. Select the area of code you want to profile and type Shift+Ctrl+P to tell the GW IDE that that is the code you want to profile.  Use Shift+Alt+P to turn off profiling.

2. Create a profiler tag in a Gosu class and place it at the start of the code area you want profiled, then at the end of the code you want profiled.

3. Open profile_code.xml and add two entries in it that include the fully qualified class name of the code you want profiled and the starting line, and the ending line.  Save and close the file. 

4. Add profiler tags to the SQL queries being run in your code inside comment lines in the form /*PROFILER:<tag_name>_START*/ and /*PROFILER:<tag_name>_END*/

Option 2 is correct.  The other options are conceived in madness.

500

When organizing tests, what should you consider?  Choose three correct answers.

1. Avg. time to complete individual tests

2. Continuous integration builds

3. Server optimization

4. Regression testing

5. Performance assessment checks

6. Gating requirements

7. Functional areas

Answers 2, 4, 7

The complete list: Functional areas, regression testing, local testing, and continuous integration builds should be considered when organizing tests

500

What is the default @RunLevel value if no value is specified?

1. RunLevel.NONE

2. RunLevel.SHUTDOWN

3. RunLevel.NO_DAEMONS

4. RunLevel.MULTIUSER

Answer 3 is correct.

500

No Question.  Feel free to come up with one.

None

500

True or False: Clear the caches for all the XXXCenter applications before profiling so as to force all queries to go to the database.

False.  Clearing the PolicyCenter cache before profiling will probably cause unrealistic results to be returned in terms of query time.  Clearing the ClaimCenter cache though is recommended.

500

True or False: Base product code is not profiled because it is well-known already.

False.  Base product code and all SQL queries are automatically profiled for performance.

M
e
n
u