anonymous
  • anonymous
How to test a class? In problem 5 we are creating classes but there is no apparent method to test them to see if we wrote them correctly. If I put a class in a separate file, how could I test this class for proper implementation?
MIT 6.00 Intro Computer Science (OCW)
chestercat
  • chestercat
I got my questions answered at brainly.com in under 10 minutes. Go to brainly.com now for free help!
At vero eos et accusamus et iusto odio dignissimos ducimus qui blanditiis praesentium voluptatum deleniti atque corrupti quos dolores et quas molestias excepturi sint occaecati cupiditate non provident, similique sunt in culpa qui officia deserunt mollitia animi, id est laborum et dolorum fuga. Et harum quidem rerum facilis est et expedita distinctio. Nam libero tempore, cum soluta nobis est eligendi optio cumque nihil impedit quo minus id quod maxime placeat facere possimus, omnis voluptas assumenda est, omnis dolor repellendus. Itaque earum rerum hic tenetur a sapiente delectus, ut aut reiciendis voluptatibus maiores alias consequatur aut perferendis doloribus asperiores repellat.

Get this expert

answer on brainly

SEE EXPERT ANSWER

Get your free account and access expert answers to this
and thousands of other questions

anonymous
  • anonymous
Creat your own def with some set parameters and show (print) them, to see if you get what you want.
anonymous
  • anonymous
All these "self" terms to specify which class confuse me. It seems like they should be implicit, not explicit. Seems like extra writing for something that is obvious. But, yes, I see now how you can make a file for each class and test them out separately by using simply outputs and inputs. class WordTrigger(Trigger): def __init__(self,word): self.word = word def is_word_in(self,text): if self.word in text: return True else: return False
anonymous
  • anonymous
Is kinda confussing the "self" at the beginning, but necessary :/

Looking for something else?

Not the answer you are looking for? Search for more explanations.