BlackFriday 2024! Hurry Up, Grab the Special Discount - Save 25% - Ends In 00:00:00 Coupon code: SAVE25
Welcome to Pass4Success

- Free Preparation Discussions

iSQI Exam CTAL-ATT Topic 3 Question 28 Discussion

Actual exam question for iSQI's CTAL-ATT exam
Question #: 28
Topic #: 3
[All CTAL-ATT Questions]

A developer has implemented a class that calculates if a given date is a leap year. The definition

for the leap year is given:

Every year that is exactly divisible by four is a leap year, except for years that are exactly

divisible by 100, but these centurial years are leap years if they are exactly divisible by 400.

- divisible by 4

- but not by 100

- years divisible by 400 are leap anyway

You have already thought about it and started with the first test class; the test class looks like

(pseudo JavaScript used here):

// LeapYear.spec.js

describe('Leap year calculator', () => {

it('should consider 1996 as leap', () => {

expect(LeapYear.isLeap(1996)).toBe(true);

});

});

What would now be your next step to proceed as efficient as possible, to validate the correctness

of the class above?

Show Suggested Answer Hide Answer
Suggested Answer: D

Contribute your Thoughts:

Ellen
5 months ago
That's a good point, perhaps writing additional test classes could provide more thorough validation.
upvoted 0 times
...
Soledad
6 months ago
I believe option A could be useful to cover all relevant aspects of the leap year calculation.
upvoted 0 times
...
Samira
6 months ago
I would also choose option D to ensure that the base functionality is working correctly.
upvoted 0 times
...
Angelo
6 months ago
I disagree, I would go with option D to make the test case pass first.
upvoted 0 times
...
Ellen
6 months ago
I think I would choose option C to make the test case fail first.
upvoted 0 times
...

Save Cancel