Cyber Monday 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
2 months 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
Bethanie
20 days ago
User1: It's better to be thorough from the start to avoid issues later on.
upvoted 0 times
...
Val
23 days ago
User2: Definitely, writing code that covers all cases is important for ensuring the class is accurate.
upvoted 0 times
...
Loreta
1 months ago
I agree, we should cover all relevant aspects of the leap year calculation.
upvoted 0 times
...
...
Tiera
2 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
1 months ago
C) First write code that makes this test case fail
upvoted 0 times
...
Oliva
1 months ago
B) First write code that covers other relevant aspects of the leap year calculation
upvoted 0 times
...
Enola
2 months ago
A) First write additional test classes to test also other relevant aspects of the leap year calculation
upvoted 0 times
...
...
Nickie
2 months ago
I would go with option C, first write code that makes this test case fail.
upvoted 0 times
...
Daron
3 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
2 months ago
C) First write code that makes this test case fail
upvoted 0 times
...
Buck
2 months ago
B) First write code that covers other relevant aspects of the leap year calculation
upvoted 0 times
...
Mozell
2 months ago
A) First write code that makes this test case pass
upvoted 0 times
...
...
Martha
3 months ago
I agree with Ressie. It's important to ensure the test case fails before making it pass.
upvoted 0 times
...
Ressie
3 months ago
I think the next step should be to write code that makes this test case fail.
upvoted 0 times
...
Maryann
3 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
2 months ago
Writing code to make the test case pass will help us validate the leap year calculation efficiently.
upvoted 0 times
...
Jose
2 months ago
Exactly, it's important to follow a systematic approach to ensure the correctness of the class.
upvoted 0 times
...
Trina
2 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
az-700  pass4success  az-104  200-301  200-201  cissp  350-401  350-201  350-501  350-601  350-801  350-901  az-720  az-305  pl-300  

Warning: Cannot modify header information - headers already sent by (output started at /pass.php:70) in /pass.php on line 77