Ian Gorton

198 papers A* 10A 6B 10C 9Misc 1Journal 51Unranked 102
YearRankTypeTitle / Venue / Authors
2025 J jnl
Commun. ACM
Ian Gorton, Alessio Bucaioni, Patrizio Pelliccione
2024 C conf
IECON
Amirali Amiri, Valentin P. Just, Gernot Steindl, Stefan Nastic, Wolfgang Kastner, Ian Gorton
2024 conf
ICSA-C
Ian Gorton, Yingyi Tong, Siyu Yao
2024 conf
SSE
Amirali Amiri, Gernot Steindl, Ian Gorton, Siegfried Hollerer, Wolfgang Kastner, Thilo Sauter
2024 J jnl
IEEE Softw.
Ian Gorton, Liz Fong-Jones, Alf Larsson
2023 conf
CLEF (Working Notes)
Chirayu Jhakal, Khushi Singal, Manan Suri, Divya Chaudhary, Bijendra Kumar, Ian Gorton
2023 conf
ICSA-C
Ian Gorton
2023 conf
MUWS@CIKM
Adwita Arora, Naman Dhingra, Divya Chaudhary, Ian Gorton, Bijendra Kumar
2023 conf
SemEval@ACL
Manan Suri, Aaryak Garg, Divya Chaudhary, Ian Gorton, Bijendra Kumar
2023 J jnl
CoRR
Manan Suri, Aaryak Garg, Divya Chaudhary, Ian Gorton, Bijendra Kumar
2022 conf
ICSA Companion
Ian Gorton, Vijaya Teja Rayavarapu
2022 conf
MLNLP
Manan Suri, Nalin Semwal, Divya Chaudhary, Ian Gorton, Bijendra Kumar
2021 conf
WAIN@ICSE
Akriti Chadda, Kelly Song, Raman Chandrasekar, Ian Gorton
2021 J jnl
CoRR
Akriti Chadda, Kelly Song, Raman Chandrasekar, Ian Gorton
2020 A conf
SIGCSE
Carla E. Brodley, Megan Barry, Aidan Connell, Catherine Gill, Ian Gorton, Benjamin Hescott, Bryan Lackaye, Cynthia LuBien, Leena Razzaq, Amit Shesh, Tiffani L. Williams, Andrea Pohoreckyj Danyluk
2019 conf
ECASE@ICSE
Ian Gorton, Shravanthi Rajagopal, Yan Liu
2018 A conf
ICSA
Ian Gorton, Barbora Buhnova, Neil A. Ernst, Clemens A. Szyperski
2018 J jnl
Int. J. High Perform. Comput. Netw.
Yan Liu, Jared M. Chase, Ian Gorton, Mark Rice, Adam Wynne
2017 A conf
ICSA
Ian Gorton, Ruochen Xu, Yiming Yang, Hanxiao Liu, Guoqing Zheng
2016 conf
HICSS
Hong-Mei Chen, Ian Gorton
2016 conf
MiSE@ICSE
Hanieh Alipour, Yan Liu, Abdelwahab Hamou-Lhadj, Ian Gorton
2016 conf
WICSA
John Klein, Ian Gorton, Laila Alhmoud, Joel Gao, Caglayan Gemici, Rajat Kapoor, Prasanth Nair, Varun Saravagi
2016 J jnl
IEEE Softw.
Ian Gorton, Ayse Basar Bener, Audris Mockus
2015 conf
CTS
Vicky L. Freedman, Carina Lansing, Ellen Porter, Karen Schuchardt, Zoe Guillen, Chandrika Sivaramakrishnan, Ian Gorton
2015 conf
BigData Congress
John Klein, Ian Gorton, Neil A. Ernst, Patrick Donohoe, Kim Pham, Chrisjan Matser
2015 conf
WICSA
Ian Gorton, John Klein, Albert Nurgaliev
2015 J jnl
IEEE Softw.
Ian Gorton, John Klein
2015 conf
QoSA
Xing Wu, Yan Liu, Ian Gorton
2015 conf
ECSA Workshops
Ian Gorton
2015 conf
ESEC/SIGSOFT FSE
Neil A. Ernst, Stephany Bellomo, Ipek Ozkaya, Robert L. Nord, Ian Gorton
2015 conf
PABS@ICPE
John Klein, Ian Gorton, Neil A. Ernst, Patrick Donohoe, Kim Pham, Chrisjan Matser
2015 conf
WOSP-C@ICPE
John Klein, Ian Gorton
2015 ch.
Big Data - Algorithms, Analytics, and Applications
Xing Wu, Yan Liu, Ian Gorton
2015 B conf
SERVICES
Nour Ali, Rami Bahsoon, Ian Gorton
2015 J jnl
IEEE Softw.
Stephany Bellomo, Ian Gorton, Rick Kazman
2014 J jnl
Environ. Model. Softw.
Vicky L. Freedman, Xingyuan Chen, Stefan Finsterle, Mark D. Freshley, Ian Gorton, Luke J. Gosink, Elizabeth H. Keating, Carina Lansing, William A. M. Moeglein, Christopher J. Murray, George Shu Heng Pau, Ellen Porter, Sumit Purohit, Mark Rockhold, Karen Schuchardt, Chandrika Sivaramakrishnan, Velimir V. Vesselinov, Scott R. Waichler
2014 J jnl
Computer
Ian Gorton
2014 J jnl
Comput. Sci. Eng.
Khushbu Agarwal, Sharma Poorva, Jinliang Ma, Chaomei Lo, Ian Gorton, Yan Liu
2014 B conf
SERVICES
Nour Ali, Rami Bahsoon, Ian Gorton
2014 conf
AIRE
Neil A. Ernst, Ian Gorton
2013 A* conf
ICSE
Ian Gorton, Yan Liu, Heiko Koziolek, Anne Koziolek, Mazeiar Salehie
2013 conf
SOSE
Yan Liu, Ian Gorton, Adam Wynne
2013 conf
CBSE
Ian Gorton, Yan Liu, Carina Lansing, Todd Elsethagen, Kerstin Kleese van Dam
2013 J jnl
Softw. Syst. Model.
Muhammad Ali Babar, Ian Gorton, Flávio Oquendo
2013 J jnl
IEEE Softw.
Ian Gorton
2013 B conf
SERVICES
Guang Lin, Binh Han, Jian Yin, Ian Gorton
2013 conf
HICSS
Ian Gorton, Jian Yin, Bora A. Akyol, Selim Ciraci, Terence Critchlow, Yan Liu, Tara D. Gibson, Sumit Purohit, Sharma Poorva, Vlachopoulou Maria
2013 conf
SOSE
Jian Yin, Sharma Poorva, Ian Gorton, Bora A. Akyol
2013 conf
MW4NextGen@Middleware
Ilge Akkaya, Yan Liu, Edward A. Lee, Ian Gorton
2013 conf
TwinPeaks@RE
Neil A. Ernst, Ipek Ozkaya, Robert L. Nord, Julien Delange, Stephany Bellomo, Ian Gorton
2012 A conf
ICSOC
Yan Liu, Jared Chase, Ian Gorton
2012 conf
SE4SG@ICSE
Ian Gorton, Yan Liu, Jian Yin
2012 conf
SC Companion
Jian Yin, Ian Gorton, Sharma Poorva
2012 J jnl
Comput. Sci. Eng.
Ian Gorton, Chandrika Sivaramakrishnan, Gary D. Black, Signe White, Sumit Purohit, Carina Lansing, Michael C. Madison, Karen Schuchardt, Yan Liu
2012 J jnl
IEEE Trans. Vis. Comput. Graph.
Joerg Meyer, E. Wes Bethel, Jennifer L. Horsman, Susan S. Hubbard, Harinarayan Krishnan, Alexandru Romosan, Elizabeth H. Keating, Laura Monroe, Richard Strelitz, Phil Moore, Glenn Taylor, Ben Torkian, Timothy C. Johnson, Ian Gorton
2011 conf
ITNG
Arzu Gosney, John H. Miller, Ian Gorton, Christopher S. Oehmen
2011 J jnl
IEEE Softw.
Ian Gorton, Adam Wynne, Yan Liu, Jian Yin
2011 C conf
SEKE
Yan Liu, Ian Gorton, Yousu Chen, Shuangshuang Jin
2011 conf
IPDPS Workshops
Carina Lansing, Yan Liu, Jian Yin, Abigail L. Corrigan, Zoe Guillen, Kerstin Kleese van Dam, Ian Gorton
2011 book
Ian Gorton
2011 A* conf
ICSE
Jeffrey C. Carver, Roscoe A. Bartlett, Ian Gorton, Lorin Hochstein, Diane Kelly, Judith Segal
2011 C conf
CLUSTER
Jian Yin, Khushbu Agarwal, Manoj Krishnan, Daniel G. Chavarría-Miranda, Ian Gorton, Tom Epperly
2011 Misc conf
UCC
Jian Yin, Guang Lin, Ian Gorton, Binh Han
2011 conf
SOSE
Yan Liu, Ian Gorton, Adam Wynne, Anand Kulkarni
2011 B conf
SERVICES
Ian Gorton, Yan Liu, Jian Yin, Anand Kulkarni, Adam Wynne
2011 conf
SE-CSE@ICSE
Ian Gorton, Chandrika Sivaramakrishnan, Gary D. Black, Signe White, Sumit Purohit, Michael C. Madison, Karen Schuchardt
2010 conf
FoSER
Ian Gorton, Yan Liu
2010 conf
SLAML
Wanchun Li, Ian Gorton
2010 J jnl
Adv. Comput.
Anuj R. Shah, Joshua N. Adkins, Douglas J. Baxter, William R. Cannon, Daniel G. Chavarría-Miranda, Sutanay Choudhury, Ian Gorton, Deborah K. Gracio, Todd D. Halter, Navdeep Jaitly, John R. Johnson, Richard T. Kouzes, Matthew C. Macduff, Andrés Márquez, Matthew E. Monroe, Christopher S. Oehmen, William A. Pike, Chad Scherrer, Oreste Villa, Bobbie-Jo M. Webb-Robertson, Paul D. Whitney, Nino Zuljevic
2010 conf
ICSOC Workshops
Ian Gorton, Adam Wynne, Yan Liu
2010 C conf
CloudCom
Ian Gorton, Yan Liu, Jian Yin
2010 conf
HICSS
Ian Gorton, Gary D. Black, Karen Schuchardt, Chandrika Sivaramakrishnan, Signe K. Wurstner, Peter Hui
2010 ed.
ECSA Companion Volume
Ian Gorton, Carlos E. Cuesta, Muhammad Ali Babar
2010 B ed.
ECSA
Muhammad Ali Babar, Ian Gorton
2009 conf
eScience
Ian Gorton, Zhenyu Huang, Yousu Chen, Benson Kalahar, Shuangshuang Jin, Daniel G. Chavarría-Miranda, Douglas J. Baxter, John Feo
2009 conf
eScience
Anuj R. Shah, Navdeep Jaitly, Nino Zuljevic, Matthew E. Monroe, Andrei Liyu, Ashoka D. Polpitiya, Joshua N. Adkins, Mikhail E. Belov, Gordon A. Anderson, Richard D. Smith, Ian Gorton
2009 ed.
QoSA
Raffaela Mirandola, Ian Gorton, Christine Hofmeister
2009 J jnl
Concurr. Comput. Pract. Exp.
Ian Gorton, Daniel G. Chavarría-Miranda, Jarek Nieplocha
2009 conf
SERVICES I
Jared Chase, Ian Gorton, Chandrika Sivaramakrishnan, Justin Almquist, Adam Wynne, George Chin Jr., Terence Critchlow
2009 conf
CBSE
Ian Gorton, Jared Chase, Adam Wynne, Justin Almquist, Alan R. Chappell
2009 J jnl
Computer
Muhammad Ali Babar, Ian Gorton
2009 conf
COMPSAC (2)
Gregory S. Thomas, Bill Nickless, David R. Thiede, Ian Gorton, Bill J. Pitre, Jason E. Christy, Liz Faultersack, Jeffery A. Mauth
2009 J jnl
Computer
Richard T. Kouzes, Gordon A. Anderson, Stephen T. Elbert, Ian Gorton, Deborah K. Gracio
2008 conf
HICSS
Adam Wynne, Ian Gorton, Justin Almquist, Jack Chatterton, Dave Thurman
2008 A conf
ICSOC
Yan Liu, Min'an Tan, Ian Gorton, Andrew John Clayphan
2008 conf
eScience
Anuj R. Shah, Mudita Singhal, Tara D. Gibson, Chandrika Sivaramakrishnan, Katrina M. Waters, Ian Gorton
2008 J jnl
Softw. Pract. Exp.
Ian Gorton, Yan Liu, Nihar Trivedi
2008 J jnl
Computer
Ian Gorton, Paul Greenfield, Alexander S. Szalay, Roy Williams
2008 J jnl
J. Syst. Softw.
Daniel J. Paulish, Ian Gorton, Jeff Tyree, Dilip Soni
2008 conf
ECBS
Muhammad Ali Babar, Andrew Northway, Ian Gorton, Paul Heuer, Thong Nguyen
2008 conf
QoSA
Yan Liu, Muhammad Ali Babar, Ian Gorton
2008 ed.
SIPEW
Samuel Kounev, Ian Gorton, Kai Sachs
2008 conf
WICSA
Ian Gorton
2008 conf
WICSA
Ian Gorton, Adam Wynne, Justin Almquist, Jack Chatterton
2008 J jnl
J. Syst. Softw.
Yan Liu, Ian Gorton, Vinh Kah Lee
2008 J jnl
Computer
Ian Gorton
2007 conf
ASWEC
Yan Liu, Ian Gorton, Vinh Khanh Le
2007 conf
SHARK/ADI@ICSE
Muhammad Ali Babar, Ian Gorton
2007 conf
ICSE Companion
Muhammad Ali Babar, Ian Gorton
2007 conf
WICSA
Ian Gorton, Muhammad Ali Babar
2007 conf
ASWEC
Ngoc Bao Bui, Liming Zhu, Ian Gorton, Yan Liu
2007 J jnl
J. Syst. Softw.
Ihor Kuz, Yan Liu, Ian Gorton, Gernot Heiser
2007 conf
QoSA
Muhammad Ali Babar, Len Bass, Ian Gorton
2007 A conf
SEAMS
Yan Liu, Ian Gorton
2007 J jnl
J. Syst. Softw.
Liming Zhu, Ngoc Bao Bui, Yan Liu, Ian Gorton
2007 conf
ICSOC Workshops
Yan Liu, Liming Zhu, Len Bass, Ian Gorton, Mark Staples
2007 conf
CBSE
Yan Liu, Liming Zhu, Ian Gorton
2007 conf
COMPSAC (1)
Yan Liu, Ian Gorton, Liming Zhu
2007 A* conf
ICSE
Liming Zhu, Yan Liu, Ngoc Bao Bui, Ian Gorton
2007 conf
ICCBSS
Dave Thurman, Justin Almquist, Ian Gorton, Adam Wynne, Jack Chatterton
2007 conf
CBSE
Patric Fornasier, Jim Webber, Ian Gorton
2007 conf
HICSS
Liming Zhu, Yan Liu, Ian Gorton, Ihor Kuz
2007 conf
SHARK/ADI@ICSE
Liming Zhu, Ian Gorton
2006 conf
OTM Workshops (1)
Yan Liu, Ian Gorton, Vinh Khanh Le
2006 J jnl
J. Syst. Softw.
Antony Tang, Muhammad Ali Babar, Ian Gorton, Jun Han
2006 J jnl
J. Syst. Softw.
Muhammad Ali Babar, Barbara A. Kitchenham, Liming Zhu, Ian Gorton, D. Ross Jeffery
2006 conf
SEM
Ian Gorton, Yan Liu, Nihar Trivedi
2006 ed.
CBSE
Ian Gorton, George T. Heineman, Ivica Crnkovic, Heinz W. Schmidt, Judith A. Stafford, Clemens A. Szyperski, Kurt C. Wallnau
2006 book
Ian Gorton
2006 conf
QSIC
Muhammad Ali Babar, Antony Tang, Ian Gorton, Jun Han
2006 conf
QoSA
Yan Liu, Ian Gorton, Len Bass, Cuong Hoang, Suhail Abanmi
2006 ed.
MODDM
Ian Gorton, Liming Zhu, Yan Liu, Shiping Chen
2006 A* conf
ICSE
Muhammad Ali Babar, Barbara A. Kitchenham, Ian Gorton
2005 conf
WICSA
Antony Tang, Muhammad Ali Babar, Ian Gorton, Jun Han
2005 A* conf
ICSE
Tariq Al-Naeem, Ian Gorton, Muhammad Ali Babar, Fethi A. Rabhi, Boualem Benatallah
2005 conf
HICSS
Ian Gorton, Justin Almquist, Kevin Dorow, Peng Gong, Dave Thurman
2005 A* conf
ICSE
Ian Gorton, Anna Liu
2005 conf
QSIC
Muhammad Ali Babar, Ian Gorton, D. Ross Jeffery
2005 conf
WICSA
Liming Zhu, Yan Liu, Ian Gorton, Ngoc Bao Bui
2005 J jnl
IEEE Trans. Software Eng.
Yan Liu, Alan D. Fekete, Ian Gorton
2005 conf
SEM
Peng Gong, Ian Gorton, David Dagan Feng
2005 conf
OOPSLA Companion
Liming Zhu, Yan Liu, Ian Gorton, Ngoc Bao Bui
2005 conf
CBSE
Yan Liu, Ian Gorton
2005 J jnl
J. Syst. Softw.
Shiping Chen, Yan Liu, Ian Gorton, Anna Liu
2005 conf
QoSA/SOQUA
Muhammad Ali Babar, Xiaowen Wang, Ian Gorton
2005 A* conf
ICSE
Ian Gorton, Liming Zhu
2005 J jnl
ACM SIGSOFT Softw. Eng. Notes
Tariq Al-Naeem, Ian Gorton, Fethi A. Rabhi, Boualem Benatallah
2005 J jnl
Softw. Qual. J.
Liming Zhu, Aybüke Aurum, Ian Gorton, D. Ross Jeffery
2004 conf
SEM
Yan Liu, Ian Gorton
2004 C conf
APSEC
Yan Jenny Liu, Ian Gorton
2004 A* conf
ICSE
Ian Gorton, Jereme Haack
2004 A* conf
ICSE
Ian Gorton, Anna Liu
2004 C conf
APSEC
Muhammad Ali Babar, Ian Gorton
2004 conf
HICSS
Ian Gorton, Anna Liu
2004 conf
SEM
Justin Almquist, Ian Gorton, Jereme Haack
2004 conf
WOSP
Yan Liu, Alan D. Fekete, Ian Gorton
2004 conf
Architecting Systems with Trustworthy Components
Steffen Becker, Antonio Brogi, Ian Gorton, Sven Overhage, Alexander B. Romanovsky, Massimo Tivoli
2003 J jnl
IEEE Softw.
Anna Liu, Ian Gorton
2003 B conf
EDOC
Ian Gorton, Justin Almquist, Nick Cramer, Jereme Haack, Mark Hoza
2003 conf
SELMAS
Ian Gorton, Jereme Haack, David McGee, Andrew J. Cowell, Olga A. Kuchar, Judi Thomson
2003 J jnl
IEEE Internet Comput.
Ian Gorton, Anna Liu
2003 J jnl
Softw. Test. Verification Reliab.
Phong Tran, Jeffrey Gosper, Ian Gorton
2003 conf
NDDL/VVEIS
Phong Tran, Jeffrey Gosper, Ian Gorton
2003 B conf
COMPSAC
Ian Gorton, Dave Thurman, Judi Thomson
2003 J jnl
Computer
Ian Gorton, Anna Liu, Paul Brebner
2003 B conf
COMPSAC
Piyush Maheshwari, Ian Gorton, Anna Liu
2002 C conf
APSEC
Shiping Chen, Ian Gorton
2002 conf
ICDCS Workshops
Phong Tran, Paul Greenfield, Ian Gorton
2002 C conf
APSEC
Yan Jenny Liu, Ian Gorton, Anna Liu, Shiping Chen
2002 A* conf
ICSE
Ian Gorton, Anna Liu
2002 conf
ICCBSS
Ian Gorton, Anna Liu
2001 conf
TOOLS (38)
Phong Tran, Ian Gorton
2001 conf
ICOIN
Shuping Ran, Paul Brebner, Ian Gorton
2000 conf
OOIS
Ian Gorton, Anna Liu, Phong Tran
2000 conf
ICEIS
Ian Gorton, Phong Tran
1999 conf
PDSE
Ian Gorton, Anna Liu
1998 conf
PDSE
Ian Gorton
1998 conf
PDSE
Anna Liu, Ian Gorton
1998 conf
HICSS (3)
Lei Hu, Ian Gorton
1997 conf
HICSS (6)
Ian Gorton, Toong Shoon Chan, Shijian Lu, Charles Chung
1997 conf
PDSE
Lei Hu, Ian Gorton
1997 C conf
PDP
Anna Liu, Ian Gorton
1997 conf
HICSS (1)
Innes Jelly, Peter R. Croll, Ian Gorton, Guido Wirtz
1997 conf
HICSS (2)
Ian Gorton, Igor T. Hawryszkiewycz, Kenny Ragoonaden, Charles Chung, Shijian Lu, Guneet Randhawa
1997 J jnl
Microprocess. Microsystems
Toong Shoon Chan, Ian Gorton
1997 J jnl
IEEE Concurrency
Ian Gorton, Innes Jelly
1997 J jnl
IEEE Concurrency
Innes Jelly, Ian Gorton, Helmar Burkhart, Karsten M. Decker, Alan D. Fekete, John M. Potter, Hassan Gomaa, Jeffrey Kramer, Douglas C. Schmidt, John A. Stankovic
1996 J jnl
ACM SIGSOFT Softw. Eng. Notes
Innes Jelly, Ian Gorton
1996 conf
Software Engineering for Parallel and Distributed Systems
Anna Liu, Toong Shoon Chan, Ian Gorton
1996 conf
Australian Software Engineering Conference
Igor T. Hawryszkiewycz, Ian Gorton
1996 conf
HICSS (3)
Ian Gorton, Igor T. Hawryszkiewycz, Lawrence Fung
1996 J jnl
Softw. Pract. Exp.
Toong Shoon Chan, Ian Gorton
1996 J jnl
Inf. Softw. Technol.
Ian Gorton, Sanjeev Motwani
1996 J jnl
Concurr. Pract. Exp.
Ian Gorton, Innes Jelly, Jonathan Gray, Toong Shoon Chan
1996 ed.
Software Engineering for Parallel and Distributed Systems
Innes Jelly, Ian Gorton, Peter R. Croll
1996 conf
Software Engineering for Parallel and Distributed Systems
Innes Jelly, Ian Gorton
1995 J jnl
Comput. Commun.
Toong Shoon Chan, Ian Gorton
1995 J jnl
IEEE Parallel Distributed Technol. Syst. Appl.
Ian Gorton, Jonathan Gray, Innes Jelly
1995 J jnl
IEEE Softw.
Ian Gorton
1994 conf
CONPAR
Ian Gorton, Toong Shoon Chan, Innes Jelly
1994 J jnl
Inf. Softw. Technol.
Innes Jelly, Ian Gorton
1994 J jnl
Inf. Softw. Technol.
Innes Jelly, Ian Gorton, Jonathan Gray
1994 conf
Software Quality and Productivity
Ian Gorton, Sanjeev Motwani
1993 B conf
COMPSAC
Jon Gray, Ian Gorton, Innes Jelly
1993 conf
PARCO
Innes Jelly, Ian Gorton, Jonathan Gray
1993 J jnl
Concurr. Pract. Exp.
Ian Gorton
1993 B conf
COMPSAC
Ian Gorton, Innes Jelly, Jon Gray
1990 J jnl
Microprocess. Microsystems
Michael J. Milway, Ian Gorton, John Fulcher, Alex Zelinsky
tests/integration/test_elf_extractor.py
← Index tests/integration/test_elf_extractor.py python
"""
Integration tests for the ELFExtractor base class.
"""
import pytest
from unittest.mock import Mock, patch, MagicMock

pytestmark = [pytest.mark.integration, pytest.mark.elf]


class TestELFExtractorInitialization:
    """Tests for ELFExtractor initialization."""

    def test_elf_extractor_with_valid_elf(self, elf_binary_path, mock_logger):
        """Test ELFExtractor initialization with valid ELF file."""
        from redb.extractors.elf_extractors.elf_features import ELFFeaturesExtractor

        with patch('redb.settings.ELASTIC_BINARIES_COLLECTION', 'test'):
            extractor = ELFFeaturesExtractor(elf_binary_path, mock_logger)

            assert extractor.filepath == elf_binary_path
            assert extractor._is_elf_file() is True

    def test_elf_extractor_with_invalid_file(self, pe_binary_path, mock_logger):
        """Test ELFExtractor initialization with non-ELF file."""
        from redb.extractors.elf_extractors.elf_features import ELFFeaturesExtractor

        with patch('redb.settings.ELASTIC_BINARIES_COLLECTION', 'test'):
            extractor = ELFFeaturesExtractor(pe_binary_path, mock_logger)

            # Should not be a valid ELF
            assert extractor._is_elf_file() is False

    def test_elf_extractor_with_text_file(self, temp_text_file, mock_logger):
        """Test ELFExtractor initialization with text file."""
        from redb.extractors.elf_extractors.elf_features import ELFFeaturesExtractor

        with patch('redb.settings.ELASTIC_BINARIES_COLLECTION', 'test'):
            extractor = ELFFeaturesExtractor(temp_text_file, mock_logger)

            # Should not be a valid ELF
            assert extractor._is_elf_file() is False


class TestELFExtractorMethods:
    """Tests for ELFExtractor helper methods."""

    def test_is_elf_file_true(self, elf_binary_path, mock_logger):
        """Test _is_elf_file returns True for valid ELF."""
        from redb.extractors.elf_extractors.elf_features import ELFFeaturesExtractor

        with patch('redb.settings.ELASTIC_BINARIES_COLLECTION', 'test'):
            extractor = ELFFeaturesExtractor(elf_binary_path, mock_logger)

            assert extractor._is_elf_file() is True

    def test_is_elf_file_cached(self, elf_binary_path, mock_logger):
        """Test _is_elf_file result is cached."""
        from redb.extractors.elf_extractors.elf_features import ELFFeaturesExtractor

        with patch('redb.settings.ELASTIC_BINARIES_COLLECTION', 'test'):
            extractor = ELFFeaturesExtractor(elf_binary_path, mock_logger)

            # First call
            result1 = extractor._is_elf_file()
            # Second call should use cached value
            result2 = extractor._is_elf_file()

            assert result1 == result2
            # Cache should be set
            assert extractor._elf_file_valid is not None

    def test_is_64bit(self, elf_binary_path, mock_logger):
        """Test _is_64bit method."""
        from redb.extractors.elf_extractors.elf_features import ELFFeaturesExtractor

        with patch('redb.settings.ELASTIC_BINARIES_COLLECTION', 'test'):
            extractor = ELFFeaturesExtractor(elf_binary_path, mock_logger)

            result = extractor._is_64bit()
            # Result depends on the test binary
            assert isinstance(result, bool)

    def test_is_stripped(self, elf_binary_path, mock_logger):
        """Test _is_stripped method."""
        from redb.extractors.elf_extractors.elf_features import ELFFeaturesExtractor

        with patch('redb.settings.ELASTIC_BINARIES_COLLECTION', 'test'):
            extractor = ELFFeaturesExtractor(elf_binary_path, mock_logger)

            result = extractor._is_stripped()
            assert isinstance(result, bool)

    def test_has_debug_info(self, elf_binary_path, mock_logger):
        """Test _has_debug_info method."""
        from redb.extractors.elf_extractors.elf_features import ELFFeaturesExtractor

        with patch('redb.settings.ELASTIC_BINARIES_COLLECTION', 'test'):
            extractor = ELFFeaturesExtractor(elf_binary_path, mock_logger)

            result = extractor._has_debug_info()
            assert isinstance(result, bool)

    def test_get_architecture(self, elf_binary_path, mock_logger):
        """Test _get_architecture method."""
        from redb.extractors.elf_extractors.elf_features import ELFFeaturesExtractor

        with patch('redb.settings.ELASTIC_BINARIES_COLLECTION', 'test'):
            extractor = ELFFeaturesExtractor(elf_binary_path, mock_logger)

            result = extractor._get_architecture()
            # Should return a string (architecture name)
            assert isinstance(result, str)
            assert result != ""

    def test_get_endianness(self, elf_binary_path, mock_logger):
        """Test _get_endianness method."""
        from redb.extractors.elf_extractors.elf_features import ELFFeaturesExtractor

        with patch('redb.settings.ELASTIC_BINARIES_COLLECTION', 'test'):
            extractor = ELFFeaturesExtractor(elf_binary_path, mock_logger)

            result = extractor._get_endianness()
            # Should be one of: "little", "big", or "unknown"
            assert result in ["little", "big", "unknown"]

    def test_get_file_type(self, elf_binary_path, mock_logger):
        """Test _get_file_type method."""
        from redb.extractors.elf_extractors.elf_features import ELFFeaturesExtractor

        with patch('redb.settings.ELASTIC_BINARIES_COLLECTION', 'test'):
            extractor = ELFFeaturesExtractor(elf_binary_path, mock_logger)

            result = extractor._get_file_type()
            # Should return a file type string
            assert isinstance(result, str)
            # Common values: "executable", "shared_object", "relocatable", etc.
            expected_types = ["none", "relocatable", "executable", "shared_object", "core_dump", "unknown"]
            assert result in expected_types or result.startswith("ET_")

    def test_is_pie(self, elf_binary_path, mock_logger):
        """Test _is_pie method."""
        from redb.extractors.elf_extractors.elf_features import ELFFeaturesExtractor

        with patch('redb.settings.ELASTIC_BINARIES_COLLECTION', 'test'):
            extractor = ELFFeaturesExtractor(elf_binary_path, mock_logger)

            result = extractor._is_pie()
            assert isinstance(result, bool)

    def test_has_stack_protection(self, elf_binary_path, mock_logger):
        """Test _has_stack_protection method."""
        from redb.extractors.elf_extractors.elf_features import ELFFeaturesExtractor

        with patch('redb.settings.ELASTIC_BINARIES_COLLECTION', 'test'):
            extractor = ELFFeaturesExtractor(elf_binary_path, mock_logger)

            result = extractor._has_stack_protection()
            assert isinstance(result, bool)

    def test_has_nx_bit(self, elf_binary_path, mock_logger):
        """Test _has_nx_bit method."""
        from redb.extractors.elf_extractors.elf_features import ELFFeaturesExtractor

        with patch('redb.settings.ELASTIC_BINARIES_COLLECTION', 'test'):
            extractor = ELFFeaturesExtractor(elf_binary_path, mock_logger)

            result = extractor._has_nx_bit()
            assert isinstance(result, bool)

    def test_has_relro(self, elf_binary_path, mock_logger):
        """Test _has_relro method."""
        from redb.extractors.elf_extractors.elf_features import ELFFeaturesExtractor

        with patch('redb.settings.ELASTIC_BINARIES_COLLECTION', 'test'):
            extractor = ELFFeaturesExtractor(elf_binary_path, mock_logger)

            result = extractor._has_relro()
            assert isinstance(result, bool)

    def test_get_build_id(self, elf_binary_path, mock_logger):
        """Test _get_build_id method."""
        from redb.extractors.elf_extractors.elf_features import ELFFeaturesExtractor

        with patch('redb.settings.ELASTIC_BINARIES_COLLECTION', 'test'):
            extractor = ELFFeaturesExtractor(elf_binary_path, mock_logger)

            result = extractor._get_build_id()
            # Could be None if no build ID, or a hex string
            assert result is None or isinstance(result, str)

    def test_count_sections(self, elf_binary_path, mock_logger):
        """Test _count_sections method."""
        from redb.extractors.elf_extractors.elf_features import ELFFeaturesExtractor

        with patch('redb.settings.ELASTIC_BINARIES_COLLECTION', 'test'):
            extractor = ELFFeaturesExtractor(elf_binary_path, mock_logger)

            result = extractor._count_sections()
            assert isinstance(result, int)
            assert result >= 0

    def test_count_segments(self, elf_binary_path, mock_logger):
        """Test _count_segments method."""
        from redb.extractors.elf_extractors.elf_features import ELFFeaturesExtractor

        with patch('redb.settings.ELASTIC_BINARIES_COLLECTION', 'test'):
            extractor = ELFFeaturesExtractor(elf_binary_path, mock_logger)

            result = extractor._count_segments()
            assert isinstance(result, int)
            assert result >= 0

    def test_count_symbols(self, elf_binary_path, mock_logger):
        """Test _count_symbols method."""
        from redb.extractors.elf_extractors.elf_features import ELFFeaturesExtractor

        with patch('redb.settings.ELASTIC_BINARIES_COLLECTION', 'test'):
            extractor = ELFFeaturesExtractor(elf_binary_path, mock_logger)

            result = extractor._count_symbols()
            assert isinstance(result, int)
            assert result >= 0

    def test_get_dependencies(self, elf_binary_path, mock_logger):
        """Test _get_dependencies method."""
        from redb.extractors.elf_extractors.elf_features import ELFFeaturesExtractor

        with patch('redb.settings.ELASTIC_BINARIES_COLLECTION', 'test'):
            extractor = ELFFeaturesExtractor(elf_binary_path, mock_logger)

            result = extractor._get_dependencies()
            assert isinstance(result, list)


class TestWithELFFile:
    """Tests for the _with_elf_file context manager method."""

    def test_with_elf_file_success(self, elf_binary_path, mock_logger):
        """Test _with_elf_file executes operation successfully."""
        from redb.extractors.elf_extractors.elf_features import ELFFeaturesExtractor

        with patch('redb.settings.ELASTIC_BINARIES_COLLECTION', 'test'):
            extractor = ELFFeaturesExtractor(elf_binary_path, mock_logger)

            # Define a simple operation
            def get_header(elf):
                return elf.header is not None

            result = extractor._with_elf_file(get_header)
            assert result is True

    def test_with_elf_file_error_handling(self, temp_text_file, mock_logger):
        """Test _with_elf_file handles errors gracefully."""
        from redb.extractors.elf_extractors.elf_features import ELFFeaturesExtractor

        with patch('redb.settings.ELASTIC_BINARIES_COLLECTION', 'test'):
            extractor = ELFFeaturesExtractor(temp_text_file, mock_logger)

            # Define an operation that would fail
            def get_header(elf):
                return elf.header

            result = extractor._with_elf_file(get_header)
            # Should return None on error
            assert result is None


class TestELFExtractorTag:
    """Tests for tag method in ELF extractors."""

    def test_elf_features_tag(self, elf_binary_path, mock_logger):
        """Test that ELFFeaturesExtractor returns correct tag."""
        from redb.extractors.elf_extractors.elf_features import ELFFeaturesExtractor

        with patch('redb.settings.ELASTIC_BINARIES_COLLECTION', 'test'):
            extractor = ELFFeaturesExtractor(elf_binary_path, mock_logger)
            tag = extractor.tag()
            # Should return the tag string
            assert isinstance(tag, str)
            assert "elf" in tag.lower() or "features" in tag.lower()


class TestELFExtractorClickHouseTable:
    """Tests for get_clickhouse_table method in ELF extractors."""

    def test_elf_features_clickhouse_table(self, elf_binary_path, mock_logger):
        """Test that ELFFeaturesExtractor returns correct ClickHouse table name."""
        from redb.extractors.elf_extractors.elf_features import ELFFeaturesExtractor

        with patch('redb.settings.ELASTIC_BINARIES_COLLECTION', 'test'):
            extractor = ELFFeaturesExtractor(elf_binary_path, mock_logger)
            assert extractor.get_clickhouse_table() == "redb_elf_features"


class TestELFExtractorExtract:
    """Tests for extract method in ELF extractors."""

    def test_elf_features_extract(self, elf_binary_path, mock_logger):
        """Test ELFFeaturesExtractor.extract() returns valid data."""
        from redb.extractors.elf_extractors.elf_features import ELFFeaturesExtractor
        from redb.models.dataclasses import ELFFeatures

        with patch('redb.settings.ELASTIC_BINARIES_COLLECTION', 'test'):
            extractor = ELFFeaturesExtractor(elf_binary_path, mock_logger)

            result = extractor.extract()
            assert result is not None
            assert isinstance(result, ELFFeatures)

            # Check some expected fields
            assert isinstance(result.ei_class, int)
            assert isinstance(result.ei_data, int)
            assert isinstance(result.e_entry, int)
            assert isinstance(result.number_of_sections, int)
            assert isinstance(result.number_of_segments, int)

    def test_elf_features_extract_invalid_file(self, pe_binary_path, mock_logger):
        """Test ELFFeaturesExtractor.extract() handles invalid ELF."""
        from redb.extractors.elf_extractors.elf_features import ELFFeaturesExtractor

        with patch('redb.settings.ELASTIC_BINARIES_COLLECTION', 'test'):
            extractor = ELFFeaturesExtractor(pe_binary_path, mock_logger)

            result = extractor.extract()
            # Should return None for invalid ELF
            assert result is None


class TestELFExtractorPrepareExportData:
    """Tests for prepare_export_data method in ELF extractors."""

    def test_elf_features_prepare_export_elasticsearch(self, elf_binary_path, mock_logger):
        """Test prepare_export_data for Elasticsearch."""
        from redb.extractors.elf_extractors.elf_features import ELFFeaturesExtractor

        with patch('redb.settings.ELASTIC_BINARIES_COLLECTION', 'test'):
            extractor = ELFFeaturesExtractor(elf_binary_path, mock_logger)

            # First extract
            extractor.extract()
            result = extractor.prepare_export_data("ElasticsearchExporter")
            # Should return the elf_features dataclass
            assert result is extractor.elf_features

    def test_elf_features_prepare_export_clickhouse(self, elf_binary_path, mock_logger):
        """Test prepare_export_data for ClickHouse."""
        from redb.extractors.elf_extractors.elf_features import ELFFeaturesExtractor

        with patch('redb.settings.ELASTIC_BINARIES_COLLECTION', 'test'):
            extractor = ELFFeaturesExtractor(elf_binary_path, mock_logger)

            # First extract
            extractor.extract()
            result = extractor.prepare_export_data("ClickHouseExporter")

            # Should return tuple of (data, column_names, column_type_names)
            assert isinstance(result, tuple)
            assert len(result) == 3
            data, column_names, column_type_names = result
            assert isinstance(data, list)
            assert isinstance(column_names, list)
            assert isinstance(column_type_names, list)
            # Column names and types should match in length
            assert len(column_names) == len(column_type_names)


class TestELFExtractorAdvanced:
    """Advanced tests for ELF extraction using hello_advanced binary."""

    def test_elf_advanced_features(self, elf_advanced_binary_path, mock_logger):
        """Test ELFFeaturesExtractor with more complex ELF binary."""
        from redb.extractors.elf_extractors.elf_features import ELFFeaturesExtractor

        with patch('redb.settings.ELASTIC_BINARIES_COLLECTION', 'test'):
            extractor = ELFFeaturesExtractor(elf_advanced_binary_path, mock_logger)

            result = extractor.extract()
            assert result is not None

            # Check that we can extract meaningful data
            assert result.number_of_sections > 0
            assert result.number_of_segments > 0

    def test_elf_advanced_architecture(self, elf_advanced_binary_path, mock_logger):
        """Test architecture detection for advanced ELF binary."""
        from redb.extractors.elf_extractors.elf_features import ELFFeaturesExtractor

        with patch('redb.settings.ELASTIC_BINARIES_COLLECTION', 'test'):
            extractor = ELFFeaturesExtractor(elf_advanced_binary_path, mock_logger)

            arch = extractor._get_architecture()
            # Should detect a valid architecture
            assert arch != "unknown"
            assert arch != ""