Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/java/381.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Java 生成或预测不同的可能测试用例_Java - Fatal编程技术网

Java 生成或预测不同的可能测试用例

Java 生成或预测不同的可能测试用例,java,Java,我想知道我该如何知道我的程序哪里出了问题。下面的问题是一个作业,必须在线提交。然而,在10个测试用例中,我的解决方案适用于前6个。其他4个给出了一个错误答案作为输出。测试用例没有给出或显示给参与者。因此人们能否告诉我,a应该如何为下面的问题生成我自己的测试用例集,以了解我的代码在哪些情况下失败 说明: Given M busy-time slots of N people, You need to print all the available time slots when all the N

我想知道我该如何知道我的程序哪里出了问题。下面的问题是一个作业,必须在线提交。然而,在10个测试用例中,我的解决方案适用于前6个。其他4个给出了一个错误答案作为输出。测试用例没有给出或显示给参与者。因此人们能否告诉我,a应该如何为下面的问题生成我自己的测试用例集,以了解我的代码在哪些情况下失败

说明:

Given M busy-time slots of N people, You need to print all the available time slots when all the N people can schedule a meeting for a duration of K minutes.
Event time will be of form HH MM ( where 0 <= HH <= 23 and 0 <= MM <= 59 ), K will be in the form minutes.

    Input Format:

    M K [ M number of busy time slots , K is the duration in minutes ]
    Followed by M lines with 4 numbers on each line.

Each line will be of form StartHH StartMM EndHH EndMM  [ Example 9Am-11Am time slot will be given as 9 00 11 00 ]
An event time slot is of form [Start Time, End Time ) . Which means it inclusive at start time but doesn’t include the end time. 
So an event of form 10 00  11 00 => implies that the meeting start at 10:00 and ends at 11:00, so another meeting can start at 11:00.

    Sample Input:
    5 120
    16 00 17 00
    10 30 14 30
    20 45 22 15
    10 00 13 15
    09 00 11 00

    Sample Output:
    00 00 09 00
    17 00 20 45

    Sample Input:
    8 60
    08 00 10 15
    22 00 23 15
    17 00 19 00
    07 00 09 45
    09 00 13 00
    16 00 17 45
    12 00 13 30
    11 30 12 30

    Sample Output:
    00 00 07 00
    13 30 16 00
    19 00 22 00

Constraints :
1 <= M <= 100

Note: 24 00 has to be presented as 00 00.
给定N人的M个繁忙时段,当所有N人都可以安排K分钟的会议时,您需要打印所有可用的时段。

事件时间的形式为HH-MM(其中0这里是生成测试用例的一种方法:

拿几张图表纸或把有线条的纸翻过来。在垂直线00到24之间贴上标签。然后画出重叠的“会议”模式。你应该能够识别出应该测试的会议模式

可能是这样的:

 0  1  2  3  4  5  6  7  8  9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
             ------------- (4 to 8)
                      ---- (7 to 8)
                                              --- (3 pm to 4 pm)
即:

03 60       <- Also try different lengths of desired meeting
04 00 08 00
07 00 08 00
15 00 16 00

03 60您使用多个不相关的语言标记是荒谬的。请选择一个且仅选择一个语言标记。否则,投票结束时将被视为一个过于宽泛和模糊的问题。如果该问题不是特定于语言的,那么请去掉语言标记,否则您将看起来像是在垃圾发送标记。我认为您需要使用调试器和单步执行检查您的程序。检查每个点以确保您的逻辑正确。@HovercraftFullOfEels I标记Java@HovercraftFullOfEels他没有要求我们帮助他发现程序的问题。他问我们如何帮助他生成测试用例。这似乎有点不同。@LeeMeador:谢谢你的澄清。顺便问一下,你的答案是1+。
03 60       <- Also try different lengths of desired meeting
04 00 08 00
07 00 08 00
15 00 16 00