automated documentation inference to explain failed tests
play

Automated Documentation Inference to Explain Failed Tests Sai Zhang - PowerPoint PPT Presentation

Automated Documentation Inference to Explain Failed Tests Sai Zhang University of Washington Joint work with: Cheng Zhang, Michael D. Ernst


  1. Automated Documentation Inference to Explain Failed Tests Sai Zhang University of Washington Joint work with: Cheng Zhang, Michael D. Ernst

  2. ������������������������������������� Before bug!fixing, programmers must: � find code relevant to the failure � understand why the test fails �

  3. ������������������������������� ������ �������������������������� ��������������� • Long test code • Multiple class interactions • Poor documentation �

  4. ������������� ��������������������� ��� ������ ��������� ��� ������������������� ������������������������ ������� ��������������� ������� �� ������������������� ������� �� ���������������!����"���������� ����������������#����������� $ Which parts of the test are most relevant to the failure? (The test is minimized, and does not dump a useful stack trace.) �

  5. ���������� ������������������������������������� • FailureDoc infers debugging clues : – Indicates changes to the test that will make it pass – Helps programmers understand why the test fails • FailureDoc provides a ���������� description of the failure from the perspective of the test – Automated fault localization tools pinpoint the buggy statements without explaining why �

  6. ��������������������������� (The red part is generated by FailureDoc ) ��������������������� ��� ������ ��������� ��� ������������������� %%�������������&����'���'����� �'������� ������������������������ %%�������������&���������������������� ������� ��������������� ������� �� ������������������� ������� �� ���������������!����"���������� ����������������#����������� $ The documentation indicates: • The ��� method should not accept a non Comparable object, but it does. • It is a real bug. �

  7. ������� • Overview • The FailureDoc technique • Implementation & Evaluation • Related work • Conclusion �

  8. ������������������������������� ������ ��������� (���-� (���,� (���+� ���� ���������� �������(*+� �������(*+� �������(*+� (���)�� �������(�*�+� ���������� (���+� (���,� (���-� ����������� �������(*+� �������(*+� �������(*+� ������� ��� !����"����� x = 5 x = 2 �������� ������������������� �������������� ������������� x > 0 %%�������������&�(�*�+ (���)�� �������(�*�+�

  9. ������������������������������� ������ ��������� (���-� (���,� (���+� ���� ���������� �������(*+� �������(*+� �������(*+� (���)�� �������(�*�+� ���������� (���+� (���,� (���-� ����������� �������(*+� �������(*+� �������(*+� ������� ��� !����"����� x = 5 x = 2 �������� ������������������� �������������� ������������� x > 0 %%�������������&�(�*�+ (���)�� �������(�*�+�

  10. ��������������������������������������� • Mutate the failed test by repeatedly replacing an existing input value with an alternative one – Generate a set of ������������������� tests Original test Mutated test ��� ��� ����������� ������������� ����������� ����.���/������ ������� ��������������� ������� ��������������� ��� ��� ��� ��� ������� � ���������������� ������� ���� ��������������� �������+�� ��������������������������� ��������������������������� ��� ��� ��

  11. ������������������������������ • Exhaustive selection is inefficient • Random selection may miss some values • FailureDoc selects replacement candidates by: – mapping each value to an �������� domain using an ��������� �� ������������ representation – sample each abstract domain ��

  12. ������������������������������� ������ ��������� (���-� (���,� (���+� ���� ���������� �������(*+� �������(*+� �������(*+� (���)�� �������(�*�+� ���������� (���+� (���,� (���-� ����������� �������(*+� �������(*+� �������(*+� ������� ��� !����"����� x = 5 x = 2 �������� ������������������� �������������� ������������� x > 0 %%�������������&�(�*�+ (���)�� �������(�*�+�

  13. !��������������������������� • FailureDoc executes each mutated test, and classifies it as: – Passing – Failing • The same failure as the original failed test – Unexpected exception • A different exception is thrown Original test Mutated test ��� ��� ��� ������ ��� ����)�+� ��������� ��� ������������������� ��������� ��� ������������������� ��� ��� Unexpected exception: .���/����/�'���0(������� ��

  14. "����������������������������������������� • After value replacement, FailureDoc only needs to record expressions that can affect the test result: – Computes a backward static slice from the assertion in passing and failing tests – Selectively records expression values in the slice ��

  15. ������������������������������� ������ ��������� (���-� (���,� (���+� ���� ���������� �������(*+� �������(*+� �������(*+� (���)�� �������(�*�+� ���������� (���+� (���,� (���-� ����������� �������(*+� �������(*+� �������(*+� ������� ��� !����"����� x = 5 x = 2 �������� ������������������� �������������� ������������� x > 0 %%�������������&�(�*�+ (���)�� �������(�*�+�

Download Presentation
Download Policy: The content available on the website is offered to you 'AS IS' for your personal information and use only. It cannot be commercialized, licensed, or distributed on other websites without prior consent from the author. To download a presentation, simply click this link. If you encounter any difficulties during the download process, it's possible that the publisher has removed the file from their server.

Recommend


More recommend