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 9 Question 45 Discussion

Actual exam question for iSQI's CTAL-ATT exam
Question #: 45
Topic #: 9
[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:

Eun
23 days ago
Nah, I'm going with B. We should write code that covers all the relevant aspects of the leap year calculation, not just the one test case.
upvoted 0 times
Loreta
14 days ago
I agree, we should cover all relevant aspects of the leap year calculation.
upvoted 0 times
...
...
Tiera
1 months ago
Ha! I bet the developer who wrote this class is a time traveler. They clearly know the secrets of the Gregorian calendar by heart.
upvoted 0 times
Jaclyn
3 days ago
C) First write code that makes this test case fail
upvoted 0 times
...
Oliva
15 days ago
B) First write code that covers other relevant aspects of the leap year calculation
upvoted 0 times
...
Enola
20 days ago
A) First write additional test classes to test also other relevant aspects of the leap year calculation
upvoted 0 times
...
...
Nickie
1 months ago
I would go with option C, first write code that makes this test case fail.
upvoted 0 times
...
Daron
2 months ago
I agree with Maryann. Writing the code to make the test case pass is the logical next step. That way, we can ensure the correctness of the class as we go along.
upvoted 0 times
Shelton
22 days ago
C) First write code that makes this test case fail
upvoted 0 times
...
Buck
24 days ago
B) First write code that covers other relevant aspects of the leap year calculation
upvoted 0 times
...
Mozell
28 days ago
A) First write code that makes this test case pass
upvoted 0 times
...
...
Martha
2 months ago
I agree with Ressie. It's important to ensure the test case fails before making it pass.
upvoted 0 times
...
Ressie
2 months ago
I think the next step should be to write code that makes this test case fail.
upvoted 0 times
...
Maryann
2 months ago
Hmm, I think the answer is D. We should first write the code that makes the test case pass. That's the most efficient way to proceed.
upvoted 0 times
Ciara
22 days ago
Writing code to make the test case pass will help us validate the leap year calculation efficiently.
upvoted 0 times
...
Jose
29 days ago
Exactly, it's important to follow a systematic approach to ensure the correctness of the class.
upvoted 0 times
...
Trina
1 months ago
Once the test case passes, we can then write additional test classes to cover other aspects.
upvoted 0 times
...
Cyndy
2 months ago
I agree, we should focus on making the test case pass first.
upvoted 0 times
...
...

Save Cancel