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 2 Question 32 Discussion

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

Arlette
6 months ago
In my opinion, we should first focus on writing code that covers other relevant aspects of the leap year calculation. This way, we can ensure our solution is robust.
upvoted 0 times
...
Jesusa
6 months ago
I see your point, It might be beneficial to make the current test case fail before moving forward with additional tests.
upvoted 0 times
...
Carolann
7 months ago
But what if the existing test case is flawed? Shouldn't we make it fail first to see if the code is working correctly?
upvoted 0 times
...
Arlette
7 months ago
I believe we should focus on writing additional test classes to cover all relevant scenarios before making any changes to the code.
upvoted 0 times
...
Jesusa
7 months ago
I agree with We need to ensure that the test case is covering other relevant aspects of the leap year calculation.
upvoted 0 times
...
Carolann
7 months ago
I think the next step should be to first write code that makes this test case fail.
upvoted 0 times
...
Sheridan
8 months ago
Agreed. We should make sure the class handles leap years correctly.
upvoted 0 times
...
Ahmed
8 months ago
That sounds like a good idea. We need to ensure all scenarios are covered.
upvoted 0 times
...
Yvonne
8 months ago
I think the next step should be to write code that covers other relevant aspects of the leap year calculation
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