Gotcha! Which fly trap is the best? An introduction to experimental data collection and analysis

Author(s): Matthew D. Parrotta1, Joël Dickinson1, Thomas J.S. Merritt*1

Laurentian University

Published online:

Courses: Biochemistry and Molecular BiologyBiochemistry and Molecular Biology Introductory BiologyIntroductory Biology Science Process SkillsScience Process Skills

Keywords: data analysis experimental design data collection fruit flies fly traps

2629 total view(s), 183 download(s)

to access supporting documents


Resource Image

Collecting data from experimental observations is an important component of the scientific process; likewise, the analysis of the data is essential to understanding the observed trends and patterns from any experiment. Allowing students to practice data collection and analysis is valuable to their scientific literacy and capacity. In this paper, we present a fly trap experiment that gives students the opportunity to discover which combinations of baits and trap types yield the best fly traps. Baits and traps can be made from easily available household goods, allowing this experiment to be set up with minimal preparation and at low cost. Students, individually or in small groups, set up their specific trap and bait combinations and the instructor collects them and places them in an area with flies. After a period of time, the instructor returns the traps to students who count the numbers of trapped flies. With these data, students summarize the results and evaluate the success of different combinations of trap type and baits. The experiment requires one session to construct and set-up the traps and a second session to count the flies and analyze and interpret the data. The experiment is designed for undergraduate students and can be modified to fit students’ past experience with experimental design and statistical analysis.  

Accompanying article about online adaptation of this lesson: Online Adaptation to "Gotcha! Which fly trap is the best? An introduction to experimental data collection and analysis"


Parrotta MD, Dickinson J, Merritt TJS. 2019. Gotcha! Which fly trap is the best? An introduction to experimental data collection and analysis. CourseSource. https://doi.org/10.24918/cs.2019.35.

Society Learning Goals

Science Process Skills

Lesson Learning Goals

Students will understand the process of science through experimental design and data analysis.

Lesson Learning Objectives

Students will:
  • design and execute an experiment
  • collect, organize, and summarize data
  • analyze and interpret data and make inferences

Article Context

Article Type
Course Level
Bloom's Cognitive Level
Vision and Change Core Competencies
Vision and Change Core Concepts
Class Type
Class Size
Lesson Length
Pedagogical Approaches
Principles of How People Learn
Assessment Type


One of the most common sights in a household kitchen is the speckling of fruit flies gathering around a fruit bowl. In spring, summer, and fall, the common fruit fly, Drosophila melanogaster, is an almost ubiquitous household nuisance (although this species does not actually cause any damage to fruit or produce), but their role in understanding genetics and biology is often overlooked. Flies are used extensively in genetics research labs, where their breeding and lineage are controlled and observed and D. melanogaster have been a central part of the research that led to at least five Nobel Prizes (1). Because of their small size and short life cycle, labs often have many lines (similar to families) of flies as part of their research projects (2). In the Merritt Lab, for example, we have a few hundred individual lines of flies and at any given time we may have tens of thousands of flies in the lab (that’s a lot of flies). One of the downsides to producing so many fruit flies is if they escape, you must catch them! This experiment originated from asking the question, “what is the best way to catch fruit flies?”

Fly geneticists spend an inordinate amount of time designing the perfect trap to remove stray flies from the lab. This challenge extends beyond the laboratory and into the home; a recent popular science article on trapping flies (3) had over 450,000 readers in its first year on-line; people want to build a better flytrap. In response to this, we saw an opportunity to develop a lesson that would allow students to approach this problem from the lens of a scientist. Previous studies have been performed with fly traps and various baits (4), but we adapted this into an experiment that is suitable for a group of undergraduate students. We designed an experiment focused around building fruit fly traps, as a way to introduce students to experimental design, data collection, and data analysis, through the lens of a real-world problem. The experiment is designed to be conducted with common household items and be adaptable for different sized groups of students. The traps the students produce are composed of two things; the bait and the trap. There are many different types of bait and traps are usually of three types—open, plastic wrap or paper funnel—resulting in a variety of bait-trap combinations, adding realism and complexity to the experiments and analyses.  

We have considered other lessons in the design of our own so as to create a more effective and approachable lesson for both the instructor and students. Allowing for numerous combinations of traps and baits creates a flexible experimental design based on the instructor’s available resources and needs. Other lessons have included flexibility of experimental design and materials, which eases some constraints of running this experiment for the instructors. For example, one experiment allowed for flexibility in choosing a plant type when measuring a plants response to CO2, as well as encouraging exploration of various factors and variables (such as soil components or light intensity) depending on the available equipment and resources of the instructor (5). Some instructors have written about how splitting into groups during lectures can assist in the active learning goals through collaboration and discussions (6). We wanted to encourage active learning by allowing students to interact with the design of their experiment. Encouraging the groups to discuss what baits they would like to use, including discussion around why specific baits would have different effects, can help achieve the active learning goals set out in the experiment. These goals, such as designing the experiment, and later on, interpreting the observed results, can benefit from group discussions among the students. In addition to this, modelling the experiment after a common everyday occurrence helps students be more engaged with the material, especially students with less experience participating in scientific experiments. Other articles have discussed how certain words and terminology that is common to both everyday language and the scientific community can alter student’s ideas about the scientific concepts (7). We took this principal into consideration by framing the experiment as something that is scientific, but could be done at home with relative ease. By asking the question “how do we make the best fly trap?” rather than “how do we make a fly trap that has olfactory markers sought after by Drosophila melanogaster?” we attempt to overcome the hurdle some of the scientific terms may present to some students, that would inhibit them from performing the experiment.

Intended Audience

The intended demographic for the experiment is undergraduate level students and the experiment was performed with a third-year undergraduate biology class. In addition, the experiment can be performed with high-school aged students, and was performed with younger scientists previously (TJSM’s seven-year old daughter).

The experiment has a wider than average audience age range because of its scalable implementation. For example, students less familiar with fruit fly biology or experimental design may not be asked to prepare the traps or baits, but rather be asked to count the trapped fruit flies at the end of the experiment and be able to generate tables of observed data. More experienced students may be asked to not only collect the data at the end, but perform some amount of analysis on the data, including generating graphs and making observations about which trap-bait combination worked the best. The undergraduate class that participated in the lesson described here prepared the traps and selected the baits, and counted the flies; a reasonably experienced high school student could perform the experiment as described here with little difficulty.

If the audience is at higher level than high school or early undergraduate-level classes, the experiment could include more substantial biostatistics and analysis (8). For example, students may be asked to write a null-hypothesis, and utilize statistical methods such as a power tests to determine an appropriate number of traps for each bait and trap type. Alternatively, or in addition, students may be asked to perform a chi-squared test to determine any statistical relationship between bait or trap type and trap effectiveness. Additionally, students could be asked to compute such statistics and values using software such as R; powerful statistical software increasingly being utilized in graduate work and biostatistics courses. Altering the experiment to include a focus on software and statistics could allow it to be a useful experiment for higher-level students to practice principals of biostatistics, as well as practice utilizing relevant software. An interesting future direction would be to explore the analytical chemistry and biochemistry of the different baits and compare things like organic volatiles with the effectiveness of different bait types.

Required Learning Time

The lesson will require different times depending on the implementation of the experiment. In our experiment, we had 90 minutes allocated to creating 60 trap-bait combinations, setting up the traps in a room and releasing the flies. We also had another 90-minute time block five days later for counting all of the fruit flies. In both cases, 90 minutes was sufficient time. If the students are not preparing the traps and baits and only collecting the data, one 90-minute block should be sufficient.

Prerequisite Student Knowledge

Students should have general group work skills in order to work together to select the correct baits. Students must also have some data management skill, such as being able to draw out an appropriate table to record the data into (alternatively, instructors can make up the forms and student can fill them in). Students should also have basic crafts skills in order to cut the paper funnels and seal the cups with plastic wrap.

An upper-year group may be asked to have some pre-requisite knowledge into fly biology in order to pick the most effective trap to attract fruit flies, but this is not essential to the core experiment.

Prerequisite Teacher Knowledge

The teacher must have access to fruit flies in order to run the experiment. The instructor should also be aware of what attracts fruit flies to certain bait types, which is summarized succinctly in a video by PBS and the American Chemical Society (https://www.youtube.com/watch?v=GL2ImHRxUD0&feature=youtu.be) (9). The instructor could also look at previous publications describing fly traps and trapping (3,4). The instructor may choose to focus on the biochemical reasons that a trap may be effective (perhaps with an older group), or focus more on the act of building a reasonably sound trap that work in an environment like home, where one would find flies. The instructor must also have the proper skills for cutting funnels, and creating traps in order to assist the students.


Active Learning

The active exercise has the flexibility to allow students to work individually, or in small groups, to construct the traps and count the number of flies captured.  Students can also work as a group, creating a single class-wide set of traps and collecting data across all of the traps. Students can work individually creating their own set of traps and collecting their own data and then pool data across the entire class. This second scenario would allow the comparison of small and large data sets and a discussion of sample size effects. The lesson is scalable to the group being presented; a lower-year class may require a more group-based learning activity, while an upper-year class may be able to do the data entry and analysis individually or in small groups. Required skills involve counting, computer literacy, and self-assessment.


Student performance in the lab can be assessed by reviewing a spreadsheet created by the students after the data are collected. This spreadsheet should contain a table with all observations correctly labeled and include average counts for each trap type and each bait type. In addition, student-produced bar graphs and claims about the effectiveness of different baits, traps, and bait + trap combinations can also be evaluated. Depending on the age group, the answers to these questions may be simple observatory answers, or older students may be asked to comment on the interaction between trap and bait and how that affects the observed results. A template for this spreadsheet is in supplementary materials (Supporting File S1 Excel template for data input and graph generation). Included in this spreadsheet is a sheet for generating a bar graph from the observed results, as well as a sheet for calculating the Chi-Square value for the collected result. A higher level class may be asked to use both sheets as part of there assessment.

Inclusive Teaching

The lesson is inclusive to all participants as roles can be distributed throughout small groups so all students have an opportunity to contribute to the experiment. For example, a student with visual impairment might not be able to count the fruit flies, but this student could participate in creating the traps, releasing the fruit flies, and analyzing the data. In addition, the hands-on nature of the experiment, and the direct connection to a real-world problem (flies in your fruit bowl) may appeal to some students that are not typically engaged by traditional, classroom and lecture, based learning excises.

Additionally, students working in small groups have opportunities to collaborate, share ideas, and utilize one another’s prior knowledge. Group-based work such as this allows multiple representations of the problem at hand, and free discussion between students promotes an open and transparent learning environment for any student.


Pre-class Preparations

Before the experiment is performed with the class, the students are asked to select five baits they want to use. Students are told a bait should be selected on the basis of whether it will attract a fruit fly; videos (9) exist that help the instructor explain what makes a good fruit-fly bait. Instructors can reference previous fly trap experiments that utilize wine and vinegar-based baits; these are used because of the fruit flies desire for rotting fruit (which is mimicked by the acidity of wine and vinegar) (4). The suggestions are collected from all students, tallied, and five baits are purchased for the experiment. All of the materials required to make the traps are collected before the experiment day.

In-class lecture script

To begin, the instructor shows the entire class how to create each of the three trap types. The first two traps are very straightforward. The open cup trap is simply an open cup with a bait at the bottom. The plastic wrap trap is an identical cup and bait, with plastic wrap sealed tightly across the top of the cup, held in place with an elastic band. Small holes are poked with a pencil into the plastic wrap so fruit flies can enter the trap. An example of the traps is included below, in Figure 1. Additionally, a lab protocol outlining the entire experiment is available as a supplementary file to this document (Supporting File S2: Fruit Fly Trap Lab Protocol).

The third trap replaces the plastic wrap with a simple paper funnel. The instructor demonstrates how to cut a paper funnel using plain white-paper and scissors. We have included instructions for creating the funnels in the lab protocol (Supporting File S2: Fruit Fly Trap Lab Protocol). This funnel is then inserted into the mouth of the cup, and taped into place using scotch tape. The funnel is taped around the mouth of the cup, so the only way a fruit fly could enter is through the hole in the funnel. During this demonstration, students are shown the appropriate amount of bait to include in each trap. If the bait is a liquid, it should fill the cup roughly an 2cm, and if it is a solid (like a fruit), it should cover about 1/3 to ½ of the bottom of the cup.

The class is then split into five groups, one group for each bait type. The groups are asked to create an open trap, a plastic-wrap trap, and a paper funnel trap using their assigned bait type. Each group can replicate the traps a certain number of times; during our experiment, each group created four replicates of each trap type. The instructor can cycle around groups and assist with creating the traps or answering questions about the procedure during this time.

Once a group constructs all of their traps, the group, or instructor, can bring the traps to the area in which flies will be trapped. The instructor may wait until all groups are finished building the traps to begin moving the traps to the appropriate area. In summer and fall months in areas where fruit flies are common (much of North America, for example) (10) traps can be set up near open windows and local flies trapped. In other months and locations, flies can be purchased from teaching supply companies (such as Carolina Biological) or easily cultured. For this experiment, we used an insect net to collect local fruit flies from a home composter, grew them up for about two weeks in 1 liter bottles supplied with a standard yeast/cornmeal/corn-syrup fly food and released them in a lab room. Once in the fly-area, groups will be instructed to distribute their traps around the room so that the same bait type is not clustered in one area. Once all groups have placed their traps, the flies will be released from their vials and the room will be closed for five days before counting.

After five days, the groups return to the room and collect their groups traps. Students count the flies in the trap and have a classmate recount to confirm the number in the cup. No microscopes or other tools are needed for this portion of the exercise. Once a count is complete, the students enter the data into a spreadsheet or on a chalkboard so that the data for all groups all are available to each student.

An outline of the experiment and estimated times for completing each component is outlined below in Table 1.


Pre-Experiment Activities

When this experiment was performed, it was done with an undergraduate level biology class. The class was able to quickly determine which baits to use through a vote. The materials were purchased for the experiment and the students were able to set up the experimental conditions in the pre-experiment phase simply. This portion of the experiment helped achieve the learning goals of students setting up their own experimental conditions, as they had to be able to select their own baits in order to run the experiment as described.  For less experienced groups, this process may be streamlined by having a list of baits they can select from rather than have the students generate their own ideas; this also will make it easier on the teacher when they have to purchase the baits. Bait selection may be expanded to include more background knowledge about the flies, and their ecology, for more experienced groups.

In-class Experiment

The students enjoyed the collaborative process of creating the traps and the group work involved with this creation. It is good to have this experiment done in groups, as some members of the group may be stronger than others at physical tasks such as cutting the paper funnels, and having a good funnel trap is essential to comparing trap effectiveness; some students struggled with cutting the funnels correctly, but allowing time for practice helped them learn relatively quickly. There were conversations within and between groups with students showing one another their preferred way of making traps and helping other groups who might have been struggling. This portion of the experiment should allow for this kind of interaction between students to help facilitate group work and group communication skills.

When an individual group completed their tasks, they brought their traps to the room where the flies were to be released and were instructed to space their traps out around the room so they weren’t too close to one another (this placement ensures that baits act independently; that baits are less likely to attract flies to multiple traps). Depending on the class size and the space in the room, it might be advantageous to only allow one group to set up traps at a time. The instructor may choose to also have all the groups complete their traps and then bring the traps to the fly room if that works better with their group. In our case, once all of the students had traps set up, a member from each of the five groups and myself released vials of flies all over the room, and quickly left and shut the door. When releasing the flies, it is important to tap the vials to encourage them to leave the vial and enter the room. Having fewer students in the room for this portion is easier, because you must quickly leave the room once releasing the flies so as to not accidently release fruit flies into the rest of the building.

Five-Days After Release

Students returned five days after release and met at the room where the flies were released. When we performed the experiment, not every student returned to count flies because of their course schedule. We counted every trap with two people, having one preforming an initial counting of the flies and one to confirm the count. We suggest when running this experiment that each group from the in-class experiment day count their own traps. When counting, it can sometimes be difficult to see the small fruit flies, especially if they are in wine or other dark liquids. In response to this challenge, we suggest that one student counts and then another confirms the count, to ensure accurate data collection. Further, students may also pour the trap contents through a coffee-filter, or paper towel, in order to try to catch the flies trapped but remove the liquid. This portion of the experiment achieves the learning goal of collecting raw experimental data. Each group will have a count of the number of flies for each trap-bait combination that their group was responsible for. If each group conducts multiple replications, the students will have separate counts for the replicates.

Once the counts are collected, the data should be shared across groups so that every student can create their own table that includes all of the counts from the entire group. An example of our table can be found under supporting materials (Supporting File S1:  Excel template for data input and graph generation). Each student should be assigned work in which they must input their raw data and their table of total counts into a spreadsheet software (i.e. Excel). When performed with our class, the data were inputted into Excel and several bar graphs were created including a bar-graph comparing total number of captured flies for each bait type, total number of captured flies for each trap type, and a multi-bar graph separated by bait type, showing which trap was most effective for which bait. An example graph is included below in Figure 2.

There are numerous types of graphs students can create from this dataset. For less advanced groups, simpler graphs, such as total captured flies for each trap type, could be assigned, while more advanced students could create the multi-bar graphs that highlight the interaction effect between traps and baits. This portion of the experiment achieves the lesson goal of using software to create graphics from the data. Additionally, more complex statistics such as a Chi-Square test could be performed by older students using the experimental data as a real-world dataset. This test or other biostatistics could be asked to be done by hand, or more likely to be performed in a software such as R.

Our students were assigned questions based off of the graphs they generated. These questions included “Which trap type did best overall? Worst?”, “Which bait type did best overall? Worst?” and “Which combination of trap and bait did best overall? Worst?” These questions help to achieve the learning goal of analyzing and understanding experimental data, as the students had to reflect on the data they collected, and use the graphs they generated to help answer the questions. The results from our own experiment show that the open mouth beer trap and the banana-yeast paper funnel trap were the best traps (captured the largest number of flies). Students in our example were only graded pass/fail based on participation, but the exercise does lend itself to more involved grading of student performance. Students may be asked to argue why they think the baits were appropriate or not or to reflect on why they think they saw the results they did. These questions can be assigned to be discussed as a group, or individuals, and the kinds of answers expected can scale with the students. One a simple level, students can just be asked to explain which combination of bait and trap type was most effective based on their analysis of the data they have generated. On a more advanced level, students can be asked to relate their findings to the biology of the flies; e.g. does trap effectiveness match expectations of fly behavior based on what students can find out about drosophila ecology and sensory biology? We orally quizzed students about their results and experiences, but the questions also lend themselves to more involved research and written responses.

We have several additional suggestions that instructors could follow to better tailor the experiment to their group. In expansion of this exercise to more advanced classes, potential interactions between bait and trap types may be one of the most interesting aspects of the data to explore statistically. Students could use more advanced statistics, such as analysis of variance, to explore the potential for interactions. Do all baits work as effectively in all trap types? Further, do all baits, and or trap types, work as effectively on males as females? Sexing D. melanogaster is easily done visually; males are small and more uniformly dark, while females are larger with lighter, striped, abdomens. If students record fly sex as well as fly number they can ask interesting questions about the potential behavioral differences between males and females. Only females lay eggs. Larvae that hatch from the eggs eat the substrate that females lay the eggs on. Bait choice likely reflects the evolved behavior of females selecting for suitable larval habitat. Males don’t lay eggs and are only searching for females. Students can ask, for example, does this biological difference between males and females lead to any differences in bait choice?

In addition, instructors could run this experiment in a variety of spaces or areas and do not need to acquire laboratory fruit flies if the flies are in season in their location, which is the late summer and fall in the northern hemisphere (9). The instructor may choose to have the students set up the traps outdoors or in an area around the school known to have fruit flies. Instructors may choose to intentionally use baits that don’t attract fruit flies in order to demonstrate to students there are certain biochemical properties the flies are looking for (3). This experiment is meant to be adapted to the match the student groups needs and available resources for the instructor. The bait selection process can also be expanded as a way to engage more advanced students and classes. While D. melanogaster has an extensive history as a laboratory model species, it has also been studied in the wild. Although there are still surprisingly many questions unanswered, given over a hundred years of study, much is known about the feeding ecology of the species (e.g 11) and this knowledge can be incorporated into bait selection. For example, D. melanogaster is attracted to rotting fruit more than ripe fruit and baits could be selected to mimic rot or ripening and their attractiveness compared. Baits are also an area for possible expansion of advanced classes into analytical chemistry or biochemistry. Flies are attracted to volatile molecules released from the baits (12). If appropriate equipment is accessible, students could compare the chemical profiles of different baits and possibly identify the active components. Further, if the experiment is done in the summer or fall and wild populations of flies are attracted, baits can be tailored for different Drosophila species, many of which have distinct ecology and food or habitat preferences (13,14). In North America, for example, there are natural or introduced species of Drosophila that feed on either fruit or fungus and baits could be selected to potentially capture either; similar situations exist in other locations.


  • S1: Fly Trap - Excel Template for Results. Includes data input and graph generation.
  • S2: Fly Trap - Lab Protocol for Experiment.


We would like to thank Lila Elizabeth Merritt, Teresa Rzezniczak, Eric Audette, Mathieu Losier, Jessica Keegan, Arielle Bieniek, Alex Methé, Simran Baath, Navjeet Baath, and Dr Guangdong Yang for participating in the original Fly Trap experiment. We would also like to thank all of the Fall 2018 CHMI 32017 Biochemistry of Nucleic Acids undergraduate students who participated in the experiment and helped count flies!


  1. McKie, R. 2017. Six Nobel prizes – what’s the fascination with the fruit fly?. Retrieved from https://www.theguardian.com/science/2017/oct/07/fruit-fly-fascination-nobel-prizes-genetics
  2. Allocca M, Zola S, Bellosta, P. 2018. The Fruit Fly, Drosophila melanogaster: The Making of a Model (Part I). In Drosophila melanogaster-Model for Recent Advances in Genetics and Therapeutics. InTech.
  3. Merritt, T. 2017. How to kill fruit flies, according to a scientist. The Conversation.ca https://theconversation.com/how-to-kill-fruit-flies-according-to-a-scientist-81740
  4. Landolt PJ, Adams T, Rogg H. 2012. Trapping spotted wing drosophila, Drosophila suzukii (Matsumura)(Diptera: Drosophilidae), with combinations of vinegar and wine, and acetic acid and ethanol. Journal of applied entomology, 136(1‐2), 148-154.
  5. Muilenburg V, Supanich K, Scogin S, Bultman T, Li J, Hertel L, Winnett-Murray K. 2018. A flexible, multi-week approach to plant biology - How will plants respond to higher levels of CO2? CourseSource. https://doi.org/10.24918/cs.2018.13
  6. Gross JB, Carlson BM. 2018. Implementing active learning approaches into an upper-division biology course. CourseSource. https://doi.org/10.24918/cs.2018.15
  7. Quillin K. 2014. Helping Students Overcome STUMPS: Scientific terms undermined by meanings peripheral to science. CourseSource. https://doi.org/10.24918/cs.2014.6
  8. Rosner B. 2011. Fundamentals of Biostatistics. 7th ed. Boston, MA: Brooks/Cole.
  9. Reactions (2018). How Do You Catch Fruit Flies?. American Chemical Society and PBS Digital Studios. [Video File]. Retrieved from https://www.youtube.com/watch?v=GL2ImHRxUD0&feature=youtu.be
  10. Potter M. 1994. Fruit Flies. Entomology at the University of Kentucky.
  11. Reaume CJ, Sokolowski MB. 2006. The nature of Drosophila melanogaster Current Biology Vol 16 No 16 R624.
  12. Becher PG, Hagman A, Verschut V, Chakraborty A, Rozpedowska E, Lebreton S, Bentsson M, Flick G, Witzgall P, Piskur J. 2018 Chemical Signallying and insect attraction is a conserved trait in yeasts Ecology and Evolution 8:2962-2975, DOI: 10.1002/ece3.3905
  13. Kimura MT. 1980. Evolution of food preferences in fungus-feeding Drosophila: an ecological study. Evolution 34(5):  1009-1018.
  14. Markow TA. 2015. The secret lives of Drosophila flies. eLife 4:e06793. DOI: 10.7554/eLife.06793

Article Files

to access supporting documents


Author(s): Matthew D. Parrotta1, Joël Dickinson1, Thomas J.S. Merritt*1

Laurentian University

About the Authors

*Correspondence to: Department of Chemistry and Biochemistry, 935 Ramsey Lake Rd, Sudbury, ON, P3E 2C6, Canada.

Competing Interests

This work was supported by a Natural Sciences and Engineering Research Council of Canada (NSERC) Discovery Grant (RGPIN-2018-05551) and Canada Research Chair (950-230113) to TJSM. The authors declare that there are no conflicts of interest.



There are no comments on this resource.